Hi everybody.
I have a dataset as follows
Region Week Data
------ ---- ----
Alabama 39 29
Alabama 40 31
Alabama 41 32
Florida 39 50
Florida 40 51
Florida 41 47
Georgia 38 35
Georgia 39 37
Georgia 40 33
Georgia 41 31
Because Georgia is the last row and it has data for week 38 (column data), the CategoryPlot is shown with wrong sort in the column values, showing weeks 39, 40, 41 and 38 as the last one.
The attached graph is a sample of the problem.
The code is as follows:
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint(Color.white);
plot.setRangeGridlinePaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.lightGray);
plot.setDomainGridlinesVisible(true);
plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
plot.setRowRenderingOrder(SortOrder.DESCENDING);
plot.setColumnRenderingOrder(SortOrder.ASCENDING);
Thanks.
Mauricio Ramirez
CategoryPlot Wrong Column Sort
Logged In: YES
user_id=112975
Originator: NO
This isn't a bug, although I've updated the API docs to make it a bit clearer why. The row and column rendering order ONLY change the order in which the items are drawn, NOT their position on the chart (this is only important for renderers that can draw overlapping items, like the stacked bar renderer with 3D effect). In general, the position of each item on the chart is determined by the order of the items in the dataset, so you should look carefully at how you construct your dataset and get the right order there.
That said, I plan to introduce options for reordering the items in a dataset in a future release.