Bug with zooming and axis autorange set to false?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
patb
Posts: 11
Joined: Sun Aug 03, 2008 7:55 pm

Bug with zooming and axis autorange set to false?

Post by patb » Thu Aug 07, 2008 7:49 am

Hello,

I don't know if the following is a bug, but it is definitevely a "strange" behavior:


1. Create a chart with an NumberAxis which range is set (e.g. via ".setRange( 0, 1.5 )"). This causes the "autoRange" member of the class ValueAxis to get set to "false".

2. Start your application and do a zoom. But do not drag the mouse from one point to another, that is lower and right from the first point, but drag a "negative" zoom window by clicking on one point and than dragging the mouse up/left.

3. This seems to call an "autojustage", like when you do a right click and choose "autojustage" and then "Both axis". And that is the reason,
why the "autoRange" member will again be set to true, which causes the axis to re-calculate it's range.


This makes it not possible to zoom in via the mouse, and zoom out to the default zoom factor without loosing the "autoRange" setting set to false.


A workaround could be, to get notified when a "zoom out to the default zoom factor" happens and setting the autoRange of that axis again to false. But I don't know where to register which listener for that.


Thanks for your replies.

Locked