Sort data

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

Sort data

Post by Dasch » Wed Apr 17, 2002 4:56 pm

Hi,

I'd like to know how I can have the slices in a pie in a certain order.
I have a set of results, these results are ordered in a certain way, but when I generate the PieChart, that order isn't maintained.

So, my question is, how can I conserve that order ?

Thanx in advance,
Dasch

David Gilbert

Re: Sort data

Post by David Gilbert » Thu Apr 18, 2002 8:27 am

At the moment, the PiePlot class orders the categories (which can be any subclass of java.lang.Object) using a TreeSet, so the categories are sorted according to their "natural order".

But most people are expecting the categories to stay in the order that they added the categories to the dataset, so I am going to change the way this works for the next version. Sorry for the inconvenience...

Regards,

DG.

Dasch

Re: Sort data

Post by Dasch » Thu Apr 18, 2002 1:55 pm

Thanx for your answer ! :)
I'll wait for the next release then !

Locked