Is there a event handler for clicking on a line in a chart?

Hello,

I was wondering if there is any callback function for when clicking on a line in a graph so I could fire off a change in the UI or get those values if needed. I saw there was dragComplete for rectangular selection values and a selection mode for a series, but could not find anything regarding firing a function or getting values for selecting a particular line in a graph.  Thanks for your help.

1 Reply 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team February 26, 2021 11:24 AM UTC

Hi Austin,

Greetings from Syncfusion.

We suggest you use chartMouseClick event to get the series values. In the sample, based on target id we have selected the series. We have attached the sample for your reference. 

 onChartMouseClick(args) {
    if (args.target.indexOf("charts_Series") > -1) {
      let seriesIndex = parseInt(args.target.charAt(args.target.length - 1));
      let series = this.chartInstance.series[seriesIndex];
      console.log(series);
    }
  }


Please revert us if you have any concerns.

Regards,
Durga G


Marked as answer
Loader.
Up arrow icon