问题
I'm successfully synchronizing several dygraph graphs on the zoom ranges (using zoomCallback and the updateOptions({dateWindow: new_range})).
I would like to synchronize also the highlights. When the user highlight one point (x,y) in one of the graphs, I would like to highlight all points with the same x in the other graphs.
Someone knows a way to do this?
In my particular case, each graph contains one serie only, and all series have the same x ranges.
回答1:
Set a highlightCallback
and unhighlightCallback
on each chart which calls setSelection
on the others. See the dygraphs options reference and API for syntax.
来源:https://stackoverflow.com/questions/19431540/use-highlightcallback-to-highlight-in-synchronized-graphs-points-with-same-x