"Auto range" range axis doesn't work

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
snid3ly
Posts: 23
Joined: Wed Aug 07, 2013 4:21 am
antibot: No, of course not.

"Auto range" range axis doesn't work

Post by snid3ly » Sun Nov 03, 2013 12:59 am

My chart plots nicely like this:

Image

however if i do "auto range -> range (or both) axes" It looks like this:

Image

auto range on the domain axis works great.

I'm setting the high and low values for the vertical/range axis to just a bit outside what's needed for the dataset:

Code: Select all

        NumberAxis ya = (NumberAxis) chart.getXYPlot().getRangeAxis();
        double low = dataset.getLow() - .01;
        double high = dataset.getHigh() + .01;
        ya.setRange(low , high);
Do I need to do something different so auto range will work?

Thanks...

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: "Auto range" range axis doesn't work

Post by paradoxoff » Sun Nov 03, 2013 10:00 pm

Call setAutoRangeIncludesZero(false) on your range axis.

snid3ly
Posts: 23
Joined: Wed Aug 07, 2013 4:21 am
antibot: No, of course not.

Re: "Auto range" range axis doesn't work

Post by snid3ly » Mon Nov 11, 2013 2:32 am

That did the trick. Thanks!

Locked