Chartjs-Hide the element text on line charts since it overlaps with the line

2👍

Chart.js by default doesn’t show values on top of data points. The issue must be related to chartjs-plugin-datalabels or some other script library you imported on your HTML page.

<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0"></script>

Simply remove that and you won’t see the the values on top of your data points anymore.

UPDATE

From the chartjs-plugin-datalabels documentation

This plugin registers itself globally, meaning that once imported, all charts will display labels. In case you want it enabled only for a few charts, you first need to unregister it globally:

Chart.plugins.unregister(ChartDataLabels);

Then, you can enabled the plugin only for specific charts:

var chart = new Chart(ctx, {
    plugins: [ChartDataLabels],
    options: {
        // ...
    }
})

Leave a comment