|Managing Legend items [message #1739399]
||Sun, 31 July 2016 19:54
| Alain Picard
Registered: July 2009
I am programmatically generating a bar chart. I want my legend to describe the various heat mapping colors used in the chart and not to describe each bar. As you might imagine I can have multiple bars with the same magnitude and thus the same color. So for example I can have 8 bars but only 4 different colors that I want shown in the legend.
I can easily control the color with the handler by using the beforeDrawLegendItem. I can also make the label not visible with beforeDrawLegendEntry, but I can't control the number of entries in the legend.
I looked through the code to find how I could achieve it but with no success so far. I thought I could override the Chart and implement my own getSeriesForLegend() but that is only partially used as the LegendBuilder#ContentProvider simply requests the base runtime series to get its content from. And it seems that it would be quite hard to override any part of the LegendBuilder itself.
Powered by FUDForum
. Page generated in 0.01508 seconds