Gant Chart - how to sort y axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
peterv6i
Posts: 6
Joined: Wed Jan 06, 2016 11:26 am
antibot: No, of course not.

Gant Chart - how to sort y axis

Post by peterv6i » Thu Aug 04, 2016 9:33 am

Hi,
I have this kind of dataset:

Code: Select all

static String[] podatki = {"1;01.08.2003;31.07.2016;X",
                                            "2;01.08.2016;04.08.2016;I",
                                            "3;01.08.2016;04.08.2016;K",
                                            "4;02.09.2016;30.09.2016;X",
       };
1,2,3,4 are index (sequence), then is a date_begin, date_end and (X,I,K) which are series (for X I have 2 values to draw, for I I have one value and for K one value)


In my example I get:
Image

How to draw the same graph so the values on Y axis are ordered descending or ascending (1,2,3,4) or (4,3,2,1) in my example are (1,4,3,2)?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Gant Chart - how to sort y axis

Post by paradoxoff » Sat Aug 06, 2016 6:25 pm

What you have is not a dataset, but a string array. The order in which the indices are appearing on the category axis are dependent on the order in which the columns are added to the dataset. Since you have omitted that part of your code completely.#, I can´t tell where the observed behaviour is coming from.

Locked