panning charts while zoomed in
-
- Posts: 844
- Joined: Fri Oct 13, 2006 9:29 pm
- Location: Sunnyvale, CA
panning charts while zoomed in
I have searched the forum and found many people asking about panning charts while zoomed. There are couple suggested answers, and even a couple proposed solutions. My question isn't exactly "How can I pan a chart while zoomed" more if JFreeChart has added support to make this possible/easier.
In my normal style, here are links to other threads discussing this exact topic:
Asking:
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
Asking and mention a solution from an old version of JFreeChart:
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
Asking and mention that there would be a possible solution added to JFreeChart:
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
Asking and present a temporary solution:
http://www.jfree.org/phpBB2/viewtopic.php?t=644
http://www.jfree.org/phpBB2/viewtopic.php?t=6342
In my normal style, here are links to other threads discussing this exact topic:
Asking:
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
Asking and mention a solution from an old version of JFreeChart:
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
Asking and mention that there would be a possible solution added to JFreeChart:
http://www.jfree.org/phpBB2/viewtopic.p ... ht=panning
Asking and present a temporary solution:
http://www.jfree.org/phpBB2/viewtopic.php?t=644
http://www.jfree.org/phpBB2/viewtopic.php?t=6342
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Henry Proudhon (who has been working on the experimental SWT support) is currently looking at adding panning support (I think both in the ChartPanel class for Swing, and the ChartComposite class for SWT). I'll let him know about this thread, and I'll try to take a look myself also (I'm short on time as always).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


I've also been looking for a solution.
I didn't want to get rid of the built-in zooming feature so I ended up subclassing the ChartPanel class and overriding the mousePressed and mouseDragged methods to check if the shift key was a modifier to the event. this way, if you hold down the shift key while moving the mouse you can pan (by changing the upper and lower bounds of the domain axis), and otherwise the methods pass the event to their super method and the mouse will initiate zooming. it seems to work quite well so far. I haven't tried to implement this with subplots yet.
I didn't want to get rid of the built-in zooming feature so I ended up subclassing the ChartPanel class and overriding the mousePressed and mouseDragged methods to check if the shift key was a modifier to the event. this way, if you hold down the shift key while moving the mouse you can pan (by changing the upper and lower bounds of the domain axis), and otherwise the methods pass the event to their super method and the mouse will initiate zooming. it seems to work quite well so far. I haven't tried to implement this with subplots yet.
-
- Posts: 844
- Joined: Fri Oct 13, 2006 9:29 pm
- Location: Sunnyvale, CA
Hello,
I didn't quite get the "while zoomed" part. A pan is a pan, the zoom level should not come into play. If you'd like you can establish some min/max limits to the axis (I do that).
Anyway, I think this class will do what you're asking for:
http://www.jfree.org/phpBB2/viewtopic.php?p=59287#59287
HTH,
Gustavo
I didn't quite get the "while zoomed" part. A pan is a pan, the zoom level should not come into play. If you'd like you can establish some min/max limits to the axis (I do that).
Anyway, I think this class will do what you're asking for:
http://www.jfree.org/phpBB2/viewtopic.php?p=59287#59287
HTH,
Gustavo