Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JFreeChart - how to reverse axis order

I'm creating XYPlot and I need to reverse the order on y-Axis (that is, I need lower numbers to be higher on the axis). I would appreciate any hints how to do that.

like image 413
BeataS Avatar asked Nov 01 '11 18:11

BeataS


2 Answers

I had the same problem as you. I found this:

ChartPanel.getChart().getXYPlot().getRangeAxis().setInverted(boolean)
like image 170
Roman Rdgz Avatar answered Nov 20 '22 03:11

Roman Rdgz


to reverse the Y-axis ... you can use

ChartPanel.getChart().getXYPlot().getDomainAxis().setInverted(boolean) 

Source: Reverse X-axis numeric labels in JFreeChart

like image 27
Salem Gharbi Avatar answered Nov 20 '22 05:11

Salem Gharbi