[Chartjs]-How to show data values in top of bar chart and line chart in chart.js 3

6πŸ‘

βœ…

data values on chart

If that’s your requirement.

You might want to use chartjs-plugin-datalabels plugin. It works with vue-chartjs.

import Chart from 'chart.js'
import { Line } from 'vue-chartjs'
import ChartJsPluginDataLabels from 'chartjs-plugin-datalabels'

Incase you don’t want the plugin globally.

Chart.defaults.global.plugins.datalabels.display = false;

You can find the documentation for adding a plugin https://vue-chartjs.org/api/#addplugin.

Leave a comment