I have seen a lot of comments on panning and scrolling a category dataset chart. There is mention of panning working but I have not found any code samples.
Basically, I want to move the mouse on a gantt chart and slide the right or left bounds as if the chart is a 'window' into the dataset. I have studied David Gilbert's guide but no examples of this.
Thx.
Pan/Scroll
Pan/Scroll
RB
Hi,
In an older release there was an example of panning a XY chart. That example doesn't work with the 1.0.0rc, but the way it works is simple. And I think it can also be used on the gantt chart you want.
What the example does is add a mouselistener and a mousemotionlistener to the chart panel. Using the mousePressed and mouseDragged the movement can be extracted (endPoint - startPoint).
That data can be used to calculate the new upper and lower bounds of the axis.
Addind scrollbars requires some more calculations. A zoom factor for the axis etc.
This is the demo: http://cvs.sourceforge.net/viewcvs.py/j ... 0&view=log
Might be usefull to take a look at.
Alexander
In an older release there was an example of panning a XY chart. That example doesn't work with the 1.0.0rc, but the way it works is simple. And I think it can also be used on the gantt chart you want.
What the example does is add a mouselistener and a mousemotionlistener to the chart panel. Using the mousePressed and mouseDragged the movement can be extracted (endPoint - startPoint).
That data can be used to calculate the new upper and lower bounds of the axis.
Addind scrollbars requires some more calculations. A zoom factor for the axis etc.
This is the demo: http://cvs.sourceforge.net/viewcvs.py/j ... 0&view=log
Might be usefull to take a look at.
Alexander
-
- Posts: 5
- Joined: Thu Mar 13, 2008 8:34 am