Sync chart timestamps

Can you please provide an example for this?

Instead of bumping a 15 year old thread, which is literally an example...

Can you provide more information about what you're trying to do or what is going wrong with the code snippet already provided?

Hi Paul, thanks for the quick response :slight_smile:
On mouse clicking over a chart and selecting a range event in an XYChart, the chart automatically updates its x coordinate selected date range, zooms to the selected date range.
I want to grab this selected date range and sync another chart with the same date range

Well the first half of that is what you've already copied and pasted - getZoomedStartDate() and getZoomedEndDate() are functions available on the chart component instance.

Then in your other chart you want to 'follow' that range, set the mode of the chart to 'manual' and send the two date parameters you're getting from chart A into chart B.

I guess, I am missing something.
Here is simple script that I am failing to adapt:
chart = self.getSibling("XYChart")
return "{} - {}".format(
str(chart.getZoomedStartDate()),
str(chart.getZoomedEndDate())
)

If you have an XY Chart, then you're in Perspective, not Vision, a different visualization module that didn't exist 15 years ago.

The XY Chart appears to be configured via the xAxes.date.range properties:

Which you could just link via property bindings between two charts?

I tried that. However, chart is not updating its selected date ranges when zooming. They remain the same

Then you'll have to wait for someone else to offer advice, my knowledge of Perspective taps out early, unfortunately.

1 Like

Are the charts on the same page? In the same view?
There are a couple ways to solve this, you could pass the ranges into the other chart with custom props, bind the ranges bi-bidirectionally, set up session custom props and handle the back and forth of the props that way.