can YAxis have 0 in middle and auto range at the same time

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
alsw-2000
Posts: 16
Joined: Thu May 22, 2003 12:53 pm

can YAxis have 0 in middle and auto range at the same time

Post by alsw-2000 » Fri May 30, 2003 3:23 am

Dear all,

Can I set the YAxis of a VerticalCategoryPlot to have the zero in the middle of the axis and at the same time, the range of the axis can show all the data?

I have tried the following but fail

// this can show all data in the plot but the 0 not in middle
YAxis = new VerticalNumberAxis("USD (mio)");
YAxis.centerRange(0);
YAxis.setAutoRange(true);

// this can set the 0 in middle, but the range of the axis is only -0.5 to 0.5
// it can't show all the data
YAxis2 = new VerticalNumberAxis("USD (mio)");
YAxis2.setAutoRange(true);
YAxis2.centerRange(0);


Cheers,
alsw-2000

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Jun 02, 2003 5:38 pm

It's not currently supported, but it would be fairly easy to do. You'll need to modify the autoAdjustRange() method in the NumberAxis class.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Martin
Posts: 23
Joined: Thu Apr 24, 2003 10:25 am
Location: Germany-Essen

Post by Martin » Tue Aug 31, 2004 3:45 pm

Is this feature now supported?

Regards
Martin

Locked