How to add data label only to the last data point of a line chart | Chart.js

In this video we will cover one of the viewers questions. Which is how to add data label only to the last data point of a line chart in Chart.js.

This is a great question as datalabels which are part of the chartjs-plugin-datalabels can sometimes overwhelm your user. Having too much data is not the solution as we all know “less is more”. This video covers how to show only the last data point in the datalabels.

How to add data label only to the last data point of a line chart in Chart.js

The Chartjs Datalabels Plugin

Showing the labels directly on a line chart or any type of chart can be done with the Chartjs Datalabels Plugin [chartjs-datalabels-plugin]. We have an entire series covering all the possible options of this datalabels plugin. Interested to know more check out the Chartjs Datalabels Plugin Series.

Was this page helpful?

1 comment

  1. Hello! I’m from Russia. Thank you for the video! I’m currently doing my project with chart.js, I used chart type ‘boxplot’. But I can’t. Make a video about ‘boxplot’. Thanks!

Leave a comment

Your email address will not be published.