0

Text Text

angular core 5.1.6 ng2-chart 1.6.0 visual studio 2019 community.. the code works in stack-blitz as seen in picture. but it complains about plugins.. when I copy it to my project. if I remove the Plugins it works.. but no text in center. is there another way to get text in center that does not use plugins

in otherwords want to run this code TYPESCRIPT enter image description here

1 Answers1

0

You can just use the plugin in the options, then you don't need to use the attribute in HTML. I'm using the pluginDataLabels to show my labels.

chartOptions: ChartOptions = {
...
plugins: {
   pluginDataLabels
};

It doesn't even matter where to put the pluginDataLabels in my example. It will show in every Chart. If you want to avoid that, you can check my answer here.

Simson
  • 3,373
  • 2
  • 24
  • 38
jalei005
  • 170
  • 1
  • 7