how can i increase the y axis manually.
For example, I have the following range:
min value = 0
max value = 2300
and i want to use the increment = 300.
For example again:
2300 --> max
2000
.
.
.
0900
0600
0300
0000 --> min
For default the increment is equals 100.
Thanks
Increase the y axis
Re: Increase the y axis
If my memory serves me right, this should be the NumberTickValue, but sorry, I have no example at hand, maybe later this morning.
Re: Increase the y axis
Here is the code I use:
CategoryPlot cp = (CategoryPlot)freeChart.getPlot();
NumberAxis na = (NumberAxis) cp.getRangeAxis();
na.setTickUnit(new NumberTickUnit(10.0, new java.text.DecimalFormat("###'%'")));
The NumberTickUnit(10.0, ...) is the relevant part where 10.0 is the step size. In your case I'd take 300.0 and the decimalFormat should be 0000 instead of my ###'%'. Note that you might want to save the old TickUnit in case you toggle between absolute and percent or so.
Let me know if it works (should).
CategoryPlot cp = (CategoryPlot)freeChart.getPlot();
NumberAxis na = (NumberAxis) cp.getRangeAxis();
na.setTickUnit(new NumberTickUnit(10.0, new java.text.DecimalFormat("###'%'")));
The NumberTickUnit(10.0, ...) is the relevant part where 10.0 is the step size. In your case I'd take 300.0 and the decimalFormat should be 0000 instead of my ###'%'. Note that you might want to save the old TickUnit in case you toggle between absolute and percent or so.
Let me know if it works (should).