Vertical bar chart starting from -1

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

Vertical bar chart starting from -1

Post by JB » Wed Jun 20, 2001 5:24 pm

I am trying to generate a vertical bar chart. I want the vertical bar starts from -1 instead of 0. I tried several ways, including change the static value ZERO in Plot class from 0 to -1, but can not make it work. Can someone give me help on this?

Angela

RE: Vertical bar chart starting from -1

Post by Angela » Thu Jun 21, 2001 1:50 pm

Hi,

setMinimumAxisValue(java.lang.Number value) is a method in NumberAxis which is inherited by VerticalNumberAxis so you might try:-

((VerticalNumberAxis) plot.getVerticalAxis()).setMinimumAxisValue(new Integer(-1));
// followed by
((VerticalNumberAxis) plot.getVerticalAxis()).autoAdjustRange();
// to make sure it happens

Angela

Locked