How to fix the X axis As Integer ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
abinashparija
Posts: 8
Joined: Fri May 15, 2009 1:07 pm

How to fix the X axis As Integer ?

Post by abinashparija » Mon May 18, 2009 5:07 pm

In My Project There are two Requirement

How to fix the X axis As Integer ?
How can i show the any perticular axis value at the data point in A XYLine Chart ?

uli
Posts: 24
Joined: Sat Mar 14, 2009 3:22 pm
Location: Berlin

Re: How to fix the X axis As Integer ?

Post by uli » Thu May 21, 2009 3:02 pm

Your Integer problem can be solved like this:

NumberAxis axis = new NumberAxis();
axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

To label the ticks in a special way you can use the classes TickUnits, DateTickUnit and NumberTickUnit.
See the Javadoc for more information!

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: How to fix the X axis As Integer ?

Post by david.gilbert » Fri May 22, 2009 8:03 am

abinashparija wrote:How can i show the any perticular axis value at the data point in A XYLine Chart ?
To display these on the axis you'd have to subclass the axis and override the refreshTicks() method.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked