Hi,
How can you group items on the legend.
I'm plotting events on a graph but I only need their event description to be displayed on the legend because each event description is the same colour.
Here's a sample of my events data:
Event Name
Event Description
Date
Colour
FT Advert
Publication
1 Sep 2014
Blue
New Share Type Availability
Mailshot
5 Sep 2014
Olive
Tax Benefits
12 Sep 2014
I'd like to plot each event, which I'm currently doing but because the Event Description defines the colour of the line I'd like the legend to show one instance of the Event Description next to it's line colour.
At the moment the legend will show:
----- Publication
----- Mailshot
Ideally it would just read
Kind regards,
Nathan
Ps: My apologies I've misfiled this under the WinChart forum.
Hello Nathan,
I've been working on a solution for you. I updated the sample our team provided to you previously to include another line with the same string title and added some checking in place for any duplicate titles and set that item's LegendItemVisibility property to Collapsed. The following code can be added in DataChartLine.cs.
foreach (Series series in chart.Series) { if (series is ScatterLineSeries) { if (title == series.Title as string) { scatterLine.LegendItemVisibility = Infragistics.Portable.Components.UI.Visibility.Collapsed; break; } } }
Let me know if you have any questions regarding this matter.
Thanks Michael that worked brilliantly.