Synchronizing domain crosshairs in CombinedDomainXYPlot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sergivs
Posts: 35
Joined: Tue Dec 14, 2004 5:49 am
Location: Berkeley, CA

Synchronizing domain crosshairs in CombinedDomainXYPlot

Post by sergivs » Fri Jun 29, 2007 1:42 am

Hi,

I have an app that uses the CombinedDomainXYPlot with 2 subplots and I'd like to synchronize the vertical crosshairs. Apparently, by default they are independent.

I wrote a simple synchronizer utility class that listens to plot change events, checks if the vertical crosshair has moved in one of the subplots, and, if so, moves the crosshairs to the same position in the rest of the subplots.

The problem is that only the top subplot seems to be firing the change events when the crosshairs move. I tried adding the synchronizer as listener to the CombinedDomainXYPlot instance as well as to each of the subplots, and the result is the same. When I zoom or pan the lower plot vertically, then I do see the change event from it.

Can anyone explain why I'm not getting the change events when moving crosshairs in the lower plot?

Thanks in advance,

Sergei

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Fri Oct 12, 2007 3:31 pm

Simple algorithm/patch/source code available at following link:
http://www.jfree.org/phpBB2/viewtopic.php?p=64888#64888

Locked