Hi.
I want set visibility of LEGEND or/and LABELS
in Pie Charts to false . Is it possible? How?
Thanks.
legends visibility
Thanks for the pointer. If the legend is removed, can it be added back without rebuilding the entire chart? We have an interactive builder that displays the chart changes as the user modifies the settings. If they choose to hide the legend and then choose to show it... it appears that there's currently no way to add it back.dhchou wrote:To remove legend use the removeLegend method in JFreeChart class.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You can use the addLegend() method in the JFreeChart class. You might run into a problem with the fact that the legend is added to the chart as a subtitle, and its position in the subtitle list affects its position on the chart. So there may be cases where you have to fetch all the subtitles, clear the subtitles from the chart, then add them back in the order you need. That suggests, of course, that a 'visible' flag on the LegendTitle would make things easier...and very likely I'll add one, but it won't be in time for the 1.0.0 release.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

