Reputation: 466
For example my raw data has the following columns: [timestamps, speed, latitude, longitutde]
and I use dygraphs to generate a speed
over timestamps
chart. Somehow on the same page I'd like to generate the geographic track using the latitude
& longtitude
coordinates with another charting lib (not sure exactly which one yet).
Is it then possible to make the two charts synchronized? If so, how?
The expectation is when the mouse hover on a certain speed
data point, the corresponding timestamp
is returned and can be used in some mechanism to mark the corresponding location point on the whole geographic track. And vice versa.
FWIW, timestamps
have unique values.
Upvotes: 1
Views: 155
Reputation: 16915
Yes, it is. You want to specify the highlightCallback
and unhighlightCallback
options. They get called when the user mouses over the chart and then mouses off it. Check out this demo to see when they fire. The second parameter to the highlightCallback
function is your timestamp.
Upvotes: 1