how to customize the coordinates?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
norvid
Posts: 4
Joined: Wed Jun 14, 2006 11:13 am

how to customize the coordinates?

Post by norvid » Wed Jun 14, 2006 11:24 am

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~~

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

Post by david.gilbert » Wed Jun 14, 2006 1:25 pm

JFreeChart always puts the axes at the edges of the chart, regardless of the position of the zero value.
David Gilbert
JFreeChart Project Leader

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

chandra.shekar
Posts: 2
Joined: Tue Aug 06, 2013 10:56 am
antibot: No, of course not.

Re: how to customize the coordinates?

Post by chandra.shekar » Tue Aug 06, 2013 4:39 pm

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

tukosito
Posts: 3
Joined: Mon Aug 19, 2013 10:34 am
antibot: No, of course not.

Re: how to customize the coordinates?

Post by tukosito » Fri Aug 23, 2013 10:32 am

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.

Locked