Dear all,
Can I set the YAxis of a VerticalCategoryPlot to have the zero in the middle of the axis and at the same time, the range of the axis can show all the data?
I have tried the following but fail
// this can show all data in the plot but the 0 not in middle
YAxis = new VerticalNumberAxis("USD (mio)");
YAxis.centerRange(0);
YAxis.setAutoRange(true);
// this can set the 0 in middle, but the range of the axis is only -0.5 to 0.5
// it can't show all the data
YAxis2 = new VerticalNumberAxis("USD (mio)");
YAxis2.setAutoRange(true);
YAxis2.centerRange(0);
Cheers,
alsw-2000
can YAxis have 0 in middle and auto range at the same time
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It's not currently supported, but it would be fairly easy to do. You'll need to modify the autoAdjustRange() method in the NumberAxis class.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

