OxyPlot - Synchronized Axis(s) for Two Chart

Oystein Bjorke 6 years ago 0
This discussion was imported from CodePlex

patilraviraj2007 wrote at 2012-04-12 08:56:

Hello Group Members/OxyPlot Team,

Many Thanks for giving us proper guidance on OxyPlot, I am using OxyPlot, Linear and DateTime Axis. I have Plotted two charts, where if I Zoom In/Out X-Axis of Chart1 then Chart 2 X-asis should be also perform Zoom In/Out respectively (based on operation performed) and vice versa.

Is it Possible to do in OxyPlot? Please suggest.

Thanks & Regards


objo wrote at 2012-04-18 21:18:

The axes have an AxisChanged event that you could subscribe to. The event should be raised every time the axis is changed by the user (panning, zooming, reset)

Tech_Junkie wrote at 2012-05-11 17:28:

How would you update the Axis or plot of the second chart? I'm looking for methods to change the axis (or plot) to zoom to an area between an upper and lower bound which are selected from another chart, but am unable to find how to do this. 

objo wrote at 2012-05-12 11:32:

Use the Zoom(double x0, double x1) method on the axes of the second chart. Remember to call InvalidatePlot(false) on the second chart's PlotModel afterwards.

If you are defining your plots in XAML, you can use the ActualModel property of the Plot control to access the plot models.

objo wrote at 2012-05-28 12:54:

See the new example in WpfExamples/CoupledAxesDemo