Hello:
Take a look at this chart:
http://dsl.jammconsulting.com/burnrated ... rtTest.jsp
It has decimals on the x axis, which I dont want to show.
Is there a way to tell the axis to only show whole digits?
I looked into using the NumberTickUnit class, but then I have
to give it an increment as well as a format.
I want the axis to auto calculate, but I want to control the formatting
of the display only.
I tried to go into NumberTickUnit and add my own setFormatter method,
but that did nothing.
Thanks,
Neil.
Not show decimals on x-axis?
Re: Not show decimals on x-axis?
Hi Neil,
There is a static method in the TickUnits class called createIntegerTickUnits(). This returns a collection of tick units formatted for displaying integers. So if you have a reference to a NumberAxis you can do this:
TickUnits integerTicks = TickUnits.createIntegerTickUnits();
myNumberAxis.setStandardTickUnits(integerTicks);
You can also create your own TickUnits collection and set this for the axis, if you want more control over the tick sizes that the auto tick unit mechanism uses.
Regards,
DG.
There is a static method in the TickUnits class called createIntegerTickUnits(). This returns a collection of tick units formatted for displaying integers. So if you have a reference to a NumberAxis you can do this:
TickUnits integerTicks = TickUnits.createIntegerTickUnits();
myNumberAxis.setStandardTickUnits(integerTicks);
You can also create your own TickUnits collection and set this for the axis, if you want more control over the tick sizes that the auto tick unit mechanism uses.
Regards,
DG.
Re: Not show decimals on x-axis?
David:
As always, many thanks for your help.
Neil.
As always, many thanks for your help.
Neil.