How to get correct x or y-axis label when user click on chart #9463
-
Charts 2.xx version had a way to get the label of the chart when user click on the chart element. Here is the working example : https://stackblitz.com/edit/angular-chart-js-click-label However, I am unable to accomplish the same with charts 3.xxx version.
with the above code, it works fine for bar chart, however, wrong label returned when I am pie on chart. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Screenshot. I am supposed to get the label shown in the tooltip, but the code above getting me the chart axis value - I guess |
Beta Was this translation helpful? Give feedback.
-
I was able to solve it by adding below code:
I wish chartjs documentation had a section for Angular specific development needs, would have saved my day. |
Beta Was this translation helpful? Give feedback.
I was able to solve it by adding below code:
I wish chartjs documentation had a section for Angular specific development needs, would have saved my day.