Line chart automatically moves the zero to middle

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
anujcb
Posts: 8
Joined: Thu Nov 15, 2007 12:03 am

Line chart automatically moves the zero to middle

Post by anujcb » Mon Feb 25, 2008 10:19 pm

When all the datapoints are zero the line chart automatically moved the 0 on the y-axis to the middle of the chat instead of keeping it at the bottom. Is this a bug or is this how it is designed? How can i force the line chart to keep the 0 y value at the bottom of the chart.

I tried setAutoRangeIncludesZero, setAutoRangeStickyZero and setAutoRangeMinimumSize(0.0000001)...not of them worked to make the zero on the x-0axis stick to the bottom.

Thanks for the help

anujcb
Posts: 8
Joined: Thu Nov 15, 2007 12:03 am

Post by anujcb » Mon Feb 25, 2008 10:28 pm

never mind, found the answer...just have to set the range type like this

yAxis1.setRangeType(RangeType.POSITIVE);

Thanks though

Locked