Dave, I need to have more control over the series references (especially hidding them), is there any news about new functionality?, or could you give some pointers on how could I solve this problem?
Thanks,
Diego.
series references
Re: series references
Hi Diego,
If you mean the appearance of the series in the chart legend...there's no code for hiding them. I think the easiest way to achieve this would be to override the getLegendItems() method in the Plot class, and only return the items you want to display.
Regards,
Dave Gilbert
If you mean the appearance of the series in the chart legend...there's no code for hiding them. I think the easiest way to achieve this would be to override the getLegendItems() method in the Plot class, and only return the items you want to display.
Regards,
Dave Gilbert
Re: series references
Hi Dave,
I've been looking at getLegendItems() method and the thing is that it gets the LegendItem from the renderer, and the renderer creates the LegendItem on request. Can I assume that the getLegendItem() method in the renderer class is called by whatever the class draws the legends in the chart, when it needs to?.
Maybe that way I can hide by not returning any legend or something, what do you think?
I've been looking at getLegendItems() method and the thing is that it gets the LegendItem from the renderer, and the renderer creates the LegendItem on request. Can I assume that the getLegendItem() method in the renderer class is called by whatever the class draws the legends in the chart, when it needs to?.
Maybe that way I can hide by not returning any legend or something, what do you think?
Re: series references
The renderer is used to construct an item because the renderer has access to the paint, stroke, and shape used to draw the series. But if you've overridden getLegendItems, you can just call the renderer to get the LegendItem for each series that you want to display...ignore the others.
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: series references
Dave, you said:
"you can just call the renderer to get the LegendItem for each series that you want to display"
I don´t quite understand you, the legends are displayed "by them selves" without me calling getLengendItems. I don't know which class (in jfreechart) is responsible for calling it, but that would be another aproach for hiding legends.
Another one, how can I remove a subPlot that was added to a CombinedPlot?
"you can just call the renderer to get the LegendItem for each series that you want to display"
I don´t quite understand you, the legends are displayed "by them selves" without me calling getLengendItems. I don't know which class (in jfreechart) is responsible for calling it, but that would be another aproach for hiding legends.
Another one, how can I remove a subPlot that was added to a CombinedPlot?