angular-highcharts icon indicating copy to clipboard operation
angular-highcharts copied to clipboard

how can we fir controller method on highchart click event?

Open parmodmalik opened this issue 7 years ago • 1 comments

parmodmalik avatar Jul 14 '18 09:07 parmodmalik

In the function containing your chart initialization, e.g. ngOnInit you can just set a variable to "this" and then reference it in the highcharts click event handler.

E.g.

ngOnInit() {
    const comp = this;
    this.chart = new Chart({
    ....
    });
}

You can then use "comp" in the click event handler to reference the component.

fintrader avatar Jul 14 '18 21:07 fintrader