How to auto-zoom the Range

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bcarrdba
Posts: 13
Joined: Tue Nov 18, 2008 2:19 am

How to auto-zoom the Range

Post by bcarrdba » Fri Feb 27, 2009 8:00 pm

Hi,

I searched google and the forum for this answer and couldn't find it, so I apologize if I missed it.

I'm trying to get my chart to generate "automatically" like:
http://www.oraclegiants.com/good.JPG

as opposed to how it is generating now:
http://www.oraclegiants.com/bad.JPG

I want the Range to not always start at zero when it doesn't make sense. For example if all my values are between 400k and 500k I would like to start my range at around 380k or so.

Has anyone found a method/function that I could code to accomplish this?

Kind regards,
Brian

RoyW
Posts: 93
Joined: Wed Apr 23, 2008 7:42 pm
Contact:

Re: How to auto-zoom the Range

Post by RoyW » Fri Feb 27, 2009 8:22 pm

NumberAxis.setAutoRangeIncludesZero(false);
The answer does not come from thinking outside the box, rather the answer comes from realizing the truth; There is no Box. my js site

bcarrdba
Posts: 13
Joined: Tue Nov 18, 2008 2:19 am

Re: How to auto-zoom the Range

Post by bcarrdba » Fri Feb 27, 2009 9:21 pm

Brilliant Roy!!! Thanks for taking the time to post a reply.

Locked