Is it possible to set the order of the y-Axis in the Status Chart when using the Tall Data Format? I was hoping the order in the dataset would do it but that did not work.
Theoretically, it is possible, but I doubt that you are going to want to dig in that deep.
The Status Chart uses the natural ordering of the series names (in either mode). So 0-9 will always be below alpha numeric characters and alpha numeric characters will be sorted in alphabetical order from bottom to top (e.g. A will be below B, Line 0 will be below Line A, etc.)
This stems from the implementation of the java.util.TreeMap. In theory you could implement your own extension of the StatusChartDataSet, honestly though I think this would be much more trouble than it’s worth.
From every thing I have seen I would agree with you. But mine has two series and it is showing State above Mode. I may end up making two and putting one above the other. But that is a real hack…
Yes, as is expected. S comes after M so “Mode” would be below “State”. If you change “Mode” to “mode” it will move above State.
There really isn’t a very simple way, short of making multiple charts, to accomplish what you’re looking for.
At least not that I can find.
So, it is in reverse alphabetical order?
That does not make sense to me… But, @lrose, you are correct. The documentation also shows it in reverse alphabetical order. I will just leave it the way it is. Thanks.
Well, I don’t know exactly how the inner workings handle this, but if you put the following script in the mouseClickedEvent on the chart.
You will see that it will print out the following output:
Series names are added to the array in natural order, so Mode before State. I suspect that as the renderer loops through the list it grabs the items in index ascending order (e.g. starting at 0 as opposed to array.length - 1) , thus the series are added to the chart in natural order from bottom to top.
Additional Series are “stacked” on existing series rather than the existing series being pushed up.
This of course only applies to the “Tall” format, using the “Wide” format the series are added in the order of the Columns of the dataset. So if you add a column titled State, and then a column titled Mode, then Mode will be above State when rendered.
Wide will not work for me since the two datasets don’t really line up. I’ll leave it the way it is. Thanks for your help, @lrose.