How to fix the RangeAxis?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jimmy6
Posts: 5
Joined: Fri Aug 09, 2013 3:58 pm
antibot: No, of course not.

How to fix the RangeAxis?

Post by jimmy6 » Sun Aug 09, 2015 12:22 pm

What is the setting to fix the scale of y? I set the scale of y from -100 to +100 because i wan the horizontal line start from the middle of chart but after i right click and drag left in the chart, the scale start from 0.

chart.getXYPlot().getRangeAxis(axisno).setRange(-100, 100);

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

Re: How to fix the RangeAxis?

Post by paradoxoff » Sun Aug 09, 2015 8:03 pm

It seems that while you want to drag the x axis only, you accidentally drag the y axis as well. This resets the autoRange flag to true.
I recommend to try this patch. It should allow to disable and enable panning for each axis separately.

Locked