create a new plot

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

create a new plot

Post by Jackie_chai » Thu Nov 22, 2001 5:58 am

i was creating a new plot now, and i made use of the verticalNumberAxis in it, but i dont know where i can set the max&min range of this axis in the jfreechart package.

thanx

David Gilbert

RE: create a new plot

Post by David Gilbert » Thu Nov 22, 2001 9:00 am

Hi Jackie,

The Javadoc page for VerticalNumberAxis is a good place to look, as it includes a list of the methods that VerticalNumberAxis inherits from NumberAxis (and ValueAxis before that).

The methods you need are:

setMinimumAxisValue(Number) and setMaximumAxisValue(Number).

If I recall correctly, you also need to call setAutoRange(false) BEFORE you set the minimum and maximum axis values. I'm going to change the code so that this isn't necessary as it has caused confusion for a few people, understandably.

Hope that helps...

DG.

Locked