Changing the default Legend

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Amit

Changing the default Legend

Post by Amit » Tue Feb 18, 2003 10:33 pm

How do I do that ?

Should I use chart.getCategoryPlot().getLegendItems().addAll ....
OR
chart.setLegend .....

Arnaud

Re: Changing the default Legend

Post by Arnaud » Wed Feb 19, 2003 11:03 am

Hello,

What do You mean by changing the legend :
- just choose which items (seriesnames for ex) will be displayed or not ?
- write Your own texts ?
- ... ?

Regards,
Arnaud

David Gilbert

Re: Changing the default Legend

Post by David Gilbert » Wed Feb 19, 2003 1:09 pm

The legend is coded to display each of the series in the plot. If you want to change that default behaviour you will need to override the getLegendItems() method in the plot, or write a new legend class.

Regards,

Dave Gilbert

Locked