I have a chart configuration (with amCharts) in which an eventListener is registered for the bullets. This event listener triggers another function in my chart service.
I want to trigger a method in my component as soon as the eventListener in the chart service is triggered. How can I best solve this with Angular?
My service (chart.service.ts) looks like this:
getSingleChart(chart, amChart) {
// some configs
// ...
this.chart.updateChart(amChart, () => {
// some configs
// ...
amChart.addListener('clickGraphItem', this.bulletClicked);
});
// I don't know if this method is needed?
// The idea here was to execute the method in the component, if the bulletClicked pro is true
chartBulletClicked() {
return this.bulletClicked = true;
}
}
The method in my component that should be triggered (chart.component.ts):
onBulletClicked() {
// ...
}