I am using PIE chart using Highcharts library. I need to call another API when PIE chart is clicked and show another Piechart based on click.
If I use Javascript function I am able to access the data using click function below.
plotOptions-->series-->point-->events--click
plotOptions: {
series: {
stacking: 'normal',
dataLabels: {
enabled: true,
align: 'left',
color: '#FFFFFF',
x: 0
},
point: {
events: {
click: function(te) {
console.log(this.category);
console.log(this.y);
}
}
}
},
Issue I am facing with typescript (in Angular) I am unable to access data inside click function.
Below I am unable to access this.category and this.y. Gives error on console.
Note: I can't use Javascript function since I won't be able to access any variable or call any API.
events: {
click: (event) => {
console.log(this.category);
console.log(this.y);
}
}