You must be logged in to post your query.
Home › Forums › Chart Support › Click event on line in line chart
Tagged: Drift Hunters, Hunters
How can I fire event when clikcing on line (not dots on line) using line chart.
Example – basic line chart. I want click on line (mart it with yellow arrow on image) and fire click event, where I want get all line data or index.
How can I do this?
how can I make click event when click on line (line chart) – not dots on line, but line itself?
@n-osenni,
CanvasJS click event is fired only when you click on datapoint (marker) & not when you click on line as of now. However, with a few lines of code you can achieve to detect if the click has happened on the line. To do so, you can bind click event to the chart canvas & with the help of point on the line formula, you can determine whether the click happened on the line connecting two datapoints.
Please take a look at this JSFiddle for a working example.
__ Sachin Bisht Team CanvasJS
You must be logged in to reply to this topic. Login/Register