Home › forums › Using CanvasJS › Trigger mouseover event when hovering on any point of a serie
Tagged: mouse over
Is there a way that we can trigger mouseover event when hovering on any point of the series, rather than hover on a data point? I can achieve this by modifying the library code. But I am thinking maybe there is a workaround to achieve this. Can you confirm? Thanks a lot!
You can set mouseover event handler for dataSeries which is triggered when user moves Mouse Over a dataSeries.
Hi @Indranil, I have the same question as OP. seems that for line chart, you have to hover on data points to trigger the mouseover event. What I really need is to hover on the entire series including lines and data points to trigger the event
In case of line chat, each dataPoint is represented as a marker and a line connects them. Events (click, mouseover, mousemove, mouseout) binded for dataPoints get fired when mouse event is triggered on it and not on the connecting line.
Hi @Indranil, thx for reply. Yes, that’s the current behavior. But there are some use cases that we want to trigger these events on the lines too, especially when you want to do some animations, otherwise only triggering events on datapoints would result in broken animation and inconsistency.
Events on lines are very common in other chart library like highchart or fusion chart too. https://api.highcharts.com/highcharts/plotOptions.series.events.mouseOver
Is there any plan to support this feature? as the op said, op can achieve this by tweaking source code. But we are hoping if this can be added officially
I am afraid we have events only for the dataPoints as of now.
You must be logged in to reply to this topic.