Chartjs-How to get item what been clicked on Chart (primeNg chart + angular application)

2👍

Primeng have given there own method onDataSelect to handle click event at official website. You can use that.

<p-chart type="line" [data]="data" (onDataSelect)="selectData($event)"></p-chart>

selectData(e:any){
        console.log(e.dataset);
        console.log(e.element);
        console.log(e.element._datasetIndex);
        console.log(e.element._index);
    }

I am not sure primeng supports bubble chart. Cause when I passed type as a Bubble. It is not showing anything. I tried above method in line bar etc.

Leave a comment