[Resolved]Synchronized Zoom for different ChartPanel.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
zinZ
Posts: 19
Joined: Mon Jul 09, 2007 2:18 pm

[Resolved]Synchronized Zoom for different ChartPanel.

Post by zinZ » Thu Jul 12, 2007 5:01 pm

Hello world,

I would like to to synchronize the DomainZoom between several ChartPanel whose the XYPlot have all the same domain (time actually).
i.e. when I zoom in one of the ChartPanel, I want that all the others are automatically zoomed at the same way.

I don't know if a fonction like that is already existing.
If not do you know a simple way to do it ?

May be on the side of the PlotChangeListener ? and copy the PlotChangeEvent for all the other plot ?

Thank you.
Last edited by zinZ on Fri Jul 13, 2007 8:52 am, edited 1 time in total.

RichardWest
Posts: 844
Joined: Fri Oct 13, 2006 9:29 pm
Location: Sunnyvale, CA

Post by RichardWest » Thu Jul 12, 2007 5:20 pm

If both/all plots have the same domain, why not assign them the same domain axis. If multiple plot share they same axis, they will both be updated when the axis changes (say via a zoom) on either plot. The Combined*Plot classes work on this principle.
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA

zinZ
Posts: 19
Joined: Mon Jul 09, 2007 2:18 pm

Post by zinZ » Fri Jul 13, 2007 8:52 am

Thank you a lot.

I have just overrided the domain axis created by ChartFactory for all
XYPlot.
It works very well.

I didin't think that could be as simple as that.

Locked