Chartjs-How to remove percentage calculation on top of bar in ng2-chart bar chart

1👍

I futher looked in the issue and found out that in my project global plugin was created which was wrongly implemented for every type of chart without any configrable property.

Chart.plugins.register({ // plugin implementation });

Refering to this link ChartJs Plugin

0👍

You can use the plugin: ‘chartjs-plugin-labels’ to solve the issue, here is the info to add the plugin to your Angular project:

https://emn178.github.io/chartjs-plugin-labels/

After you have the plugin installed in your project you have to add the library in the .ts file of the chart with this code snippet:

import 'chartjs-plugin-labels';

and in the plugins variable section add this code also:

 labels: {
  render: false
}

0👍

Need to import ChartDataLabels and then unregister ‘ChartDataLabels’ plugin

import ChartDataLabels from 'chartjs-plugin-datalabels';

Chart.plugins.unregister(ChartDataLabels);  // on ngAfterViewInit

Leave a comment