I'm currently working on a chart configuration using amCharts, where an eventListener is registered for the bullets. This event listener then triggers another function in my chart service.
My goal is to activate a method in my component as soon as the eventListener in the chart service is triggered. What would be the best way to achieve this using Angular?
Here's a snippet of my chart service (chart.service.ts):
getSingleChart(chart, amChart) {
// some configurations
// ...
this.chart.updateChart(amChart, () => {
// some configurations
// ...
amChart.addListener('clickGraphItem', this.bulletClicked);
});
// Not sure if this method is necessary?
// The intention here was to execute the method in the component when bulletClicked pro is true
chartBulletClicked() {
return this.bulletClicked = true;
}
}
The method in my component that should be triggered (chart.component.ts):
onBulletClicked() {
// ...
}