How to change the order of items in the legend?

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

How to change the order of items in the legend?

Post by make__ » Tue Dec 16, 2003 12:17 pm

Hi,

How can I change the order of items in the legend without affecting the order of series in the diagram. I want to show the series in opposite order in the legend. How can I do that?

fse
Posts: 25
Joined: Thu Mar 27, 2003 9:21 am
Location: cologne, germany
Contact:

Re: How to change the order of items in the legend?

Post by fse » Tue Dec 16, 2003 3:04 pm

hi make__,

i sort the items in the series i show in the chart and then i have my legend items sorted accordingly.

bye
frank
make__ wrote:Hi,

How can I change the order of items in the legend without affecting the order of series in the diagram. I want to show the series in opposite order in the legend. How can I do that?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Dec 16, 2003 10:40 pm

Take a look in the getLegendItems(...) method in the CategoryPlot and XYPlot classes. There is probably a way to modify it to do what you are after.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked