Oscar McCullough
Oscar McCullough

Reputation: 375

Clickable Data Labels in Highcharts-ng?

I'd like to add an angular ng-click event or onClick event to some pie charts I have in my Angular App. The pie chart looks like this:

enter image description here

What I'd like to do is when I click on that text that it applies some filtering logic I have.

However adding an ng-click to the formatter in highcharts-ng such as:

'<span ng-click="doSomething()"><b>' + this.point.name + '</b>: ' + Highcharts.numberFormat(this.percentage, 2) + '%</span>';

Does not work.

I'm not sure how to make the data labels clickable in highcharts-ng.

Upvotes: 0

Views: 773

Answers (1)

Oscar McCullough
Oscar McCullough

Reputation: 375

I have looked through my code and run through the app multiple times and have determined it is actually not an issue with the data-labels. There's a $timeout used when rendering the code that for some reason removes the clickability of the labels. Without the timeout, I can click on the labels. However, it removes the this.percentage of the chart.

Upvotes: 0

Related Questions