angular-chart.js
angular-chart.js copied to clipboard
support plugins for chartjs
Hi Jerome,
Good afternoon. In my project I was planning to use chartjs plugins. but I could not, so I added new directive to support that on the top of your code. I know I have to create issue, but its not an issue, It's kind of enhancement
we have need for this too - can this get merged?
I'm also looking for support for plugins. Any advice on how to implement/combine angular-chart.js with chartjs-plugin-datalabels (e.g.: https://chartjs-plugin-datalabels.netlify.com/samples/charts/bar.html)? Especially when packaging with webpack. Thanks!
@jtblin any chance this could be merged? Nice and simple but adds a huge amount of functionality and access to all the plugin events.
@bchekuri If I am using your version of the library, how can I apply plugins now? If it is through a directive then, what is the directive name to be used in the canvas?
@abhinav1602 there's a somewhat hacky way to do what you need with the current version. This is how I've done it.
this.$scope.$on('chart-create', (event, chart) => {
chart.config.plugins = {
afterDraw: this.drawRelativeBand,
};
chart.update();
this.chartInstance = chart;
});