Hi
I am using the VerticalNumberAxis for a Y axis.
I would like to know if it is possible to specify the actual number of ticks. For example, if I wanted 3 ticks at equal intervals, thus dividing the axis into 4 parts, regardless of the data, how would I do this?
Hope this makes sense!
Any help would be appreciated.
Thanks in advance
Y axis tick label frequency
Re: Y axis tick label frequency
You would need to calculate this yourself, then call the setTickUnit method in the NumberAxis class to specify a fixed tick unit.
That's only a partial solution, because then every time the dataset updates, you would need to recalculate the tick unit and set it again. The alternative would be to create your own subclass of VerticalNumberAxis and override the autoAdjustRange method, and the selectAutoTickUnit method (which unfortunately is private, but I can change that to protected if you want to go down this route).
Regards,
DG.
That's only a partial solution, because then every time the dataset updates, you would need to recalculate the tick unit and set it again. The alternative would be to create your own subclass of VerticalNumberAxis and override the autoAdjustRange method, and the selectAutoTickUnit method (which unfortunately is private, but I can change that to protected if you want to go down this route).
Regards,
DG.