0

Hi i am new to jfreechart.

I had set the manual range for both xAxis and yAxis.When I performing zooming operation on the graph it is zoomed.

But the problem is whenever I zoomed out of the graph the RangeAxis(yAxis values) was set to its default values and not to set my own values on YAXIS.

is there any property to disable auto range on yaxis while zooming?

Please help me, I have been troubling with this issue..

Thanks in advance..

Babu R
  • 1,025
  • 8
  • 20
  • 40

2 Answers2

0

See ChartPanel documentation:

chartPanel.setDomainZoomable(false);
chartPanel.setRangeZoomable(false);

You can also consider overriding ChartPanel.restoreAutoBounds(), as suggested in another question.

Community
  • 1
  • 1
Matthieu
  • 2,736
  • 4
  • 57
  • 87
0

Stumbled across this old post from a Google search. In case anyone digs this question up, I think what you'd want in this case is:

plot.getRangeAxis().setAutoRange( false );

Should tell the y axis not to recalculate and override your manually defined range, which I believe is what you were after. No idea if this existed years ago when you asked the question, but it's there now.

Evan
  • 2,441
  • 23
  • 36