We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can't select a point in series in component source code

Is there any way to select a point of series in your component.

"selectedDataIndexes" does not work after the chart has rendered.

Example: select a point by index on button click :
https://stackblitz.com/edit/angular-hehuvj-ati7xz?file=app.component.ts

1 Reply

KC Kalaimathi Chellaiah Syncfusion Team August 5, 2019 05:22 AM UTC

Hi Akshay, 
 
Greetings from Syncfusion. 
 
We have analyzed your query. From that we would like to let you know that the series not refreshed when we used selectedDataIndex property through button click. That’s why the problem is occurred. By calling chart refresh() method, you can resolve this problem. We have modified the attached sample. Now point selection is working fine as you expect. Please find below, 
 
Code Snippet: 
selectIndex(i: number) { 
    this.chart.selectedDataIndexes = [{series: 0, point: i}]; 
    this.chart.refresh(); 
    // select element on index i  
  } 
 
 
Screenshots: 
Initial Rendering 
After Button Click 
 
 
 
 
Please let me know if you have any queries. 

Regards, 
Kalai. 


Loader.
Live Chat Icon For mobile
Up arrow icon