angular-chart.js icon indicating copy to clipboard operation
angular-chart.js copied to clipboard

support plugins for chartjs

Open bchekuri opened this issue 7 years ago • 5 comments

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

bchekuri avatar Jun 15 '17 20:06 bchekuri

we have need for this too - can this get merged?

ngotoandev avatar Jul 26 '17 22:07 ngotoandev

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!

sanderboom avatar Oct 19 '17 08:10 sanderboom

@jtblin any chance this could be merged? Nice and simple but adds a huge amount of functionality and access to all the plugin events.

jasonfah avatar Apr 12 '18 04:04 jasonfah

@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 avatar May 30 '18 14:05 abhinav1602

@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;
});

jasonfah avatar May 30 '18 22:05 jasonfah