[Chartjs]-Chartjs plugin datalabels does not show value on charts

2👍

As per the documentation you still need to register the plugin before you can use it:

import {Chart} from 'chart.js';
import ChartDataLabels from 'chartjs-plugin-datalabels';

Chart.register(ChartDataLabels);

Working codesandbox: https://codesandbox.io/s/chart-js-plugin-forked-dig8k?file=/src/App.tsx

1👍

First you need to register the chartjs-plugin-datalabels plugin.

For Registration you can also add plugins props to your TsChart.

  1. import ChartDataLabels from "chartjs-plugin-datalabels";

  2. In TsChart tag add plugins props which accepts

Chart.PluginServiceRegistrationOptions[]
 
Eg. **TsChart type="bar" data={data} options={options} plugins={[ChartDataLabels]}** 

Leave a comment