auto adjustement in XY plot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Liao yunhe

auto adjustement in XY plot

Post by Liao yunhe » Thu Mar 14, 2002 9:01 am

Hi,
for the XY plot, when the value of Y Axis is far away from 0(range 5000-6000), how to set the value of Y axis to display the graph only in this range? Thank u very much.

YaoYue

Re: auto adjustement in XY plot

Post by YaoYue » Thu Mar 14, 2002 9:05 am

Hi Liao Yunhe
You can try the NumberAxis.setAutoRangeIncludesZero(boolean flag)
Sets the flag that indicates whether or not the automatic axis range is forced to include zero.


Regards,

David Gilbert

Re: auto adjustement in XY plot

Post by David Gilbert » Thu Mar 14, 2002 9:54 am

Good answer - thanks!

Early on in the development of JFreeChart a statistician asked me to include the flag to ensure that zero is included in the range...some charts can be misleading if you don't include zero. At the same time, some charts are completely useless if all the data is crammed at one end of the axis range (I suspect this is the case for the original poster). So you have the flag and you can choose whichever way is best for your chart...

Regards,

DG.

Locked