I have a TPointSeries in a chart that contains other series (TMapSeries).
I add XY points to on TPointSeries and use one of 5 colors for each point in the series.
I would like the legend to not show the other series, just the TPointSeries and always have 5 items in the legend, one for each color in the TPointSeries, with text that I set. So how do I:
1) Always have 5 items in the legend?
2) Custom draw the same symbol with the correct color that the TPointSeries is using in the TChart.legend.Symbol.OnDraw event (assuming I use that event).
The TExtraLegendTool, but this doesn't allow the level of customization I want (or at least it wasn't obvious to me) and didn't have any events. Maybe I am missing the obvious?
Thanks
Ed Dresel
Customizing the Legend
Hi, Ed.
The easiest solution would be to add five "fake" series and use it only for displaying legend items. Then set all other series ShowInLegend property to false. The end result will be 5 legend items for which you can control text (series Title property), color (series Color property) and symbol (series Pointer.Style property).
Of course, you can also use chart OnGetLegend*** events to customize and manually draw legend items, but I think using the above approach is a lot simpler.
The easiest solution would be to add five "fake" series and use it only for displaying legend items. Then set all other series ShowInLegend property to false. The end result will be 5 legend items for which you can control text (series Title property), color (series Color property) and symbol (series Pointer.Style property).
Of course, you can also use chart OnGetLegend*** events to customize and manually draw legend items, but I think using the above approach is a lot simpler.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
-
- Newbie
- Posts: 71
- Joined: Fri Jul 02, 2004 4:00 am
- Location: Culver City
- Contact: