hi, i am a fresh me in jfreechart, and i met a problem:
how to position the axis, such as placing the x-axis in the middle? Please help!!!
something likes this:
3 |
2 |
1 |
0 |_______________________________
-1|
-2|
-3|
i know a method is to set a value 3, and another value -3. but i want to make the initd chart like that wether i set the value or not.
Help~~
how to customize the coordinates?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
JFreeChart always puts the axes at the edges of the chart, regardless of the position of the zero value.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 2
- Joined: Tue Aug 06, 2013 10:56 am
- antibot: No, of course not.
Re: how to customize the coordinates?
Hi any one found how to customize coordinates of x-axis to start from 0 position of Y-axis.
2
1
0 ________1 2 3 ___________________________________________________________
-4 ____________X-Axis Scale______________-
-6
Let us know if anybody knows how to change xaxis scale as above
regards,
chandra shekar.k
2
1
0 ________1 2 3 ___________________________________________________________
-4 ____________X-Axis Scale______________-
-6
Let us know if anybody knows how to change xaxis scale as above
regards,
chandra shekar.k
Re: how to customize the coordinates?
What you probably want is to set the range of the data, not the axis. The axis is the component that displays the labels and the ticks with information about the charted data.
The axis object contains methods to decide whether the chart will be adjusted to all the data or other limits are going to be set. For example, you may want to use the method setRange(minValue, maxValue) of the ValueAxis of your plot.
The axis object contains methods to decide whether the chart will be adjusted to all the data or other limits are going to be set. For example, you may want to use the method setRange(minValue, maxValue) of the ValueAxis of your plot.