Skip to Main Content
Learn Chart.js
book

Learn Chart.js

by Helder da Rocha
February 2019
Beginner to intermediate content levelBeginner to intermediate
284 pages
6h 20m
English
Packt Publishing
Content preview from Learn Chart.js

Adding labels to lines, bars, and slices

In Chapter 4, Creating Charts, we used a simple plugin to add labels to pie slices. In this section, we will show you two others that allow a lot more customization. They are listed in the official documentation for Chart.js but are developed by third parties and should be installed or downloaded from their own repositories.

The chart-plugin-datalabels plugin offers the highly customizable labeling of values in all types of charts, with support for scripting and event handling. You can see several samples in chartjs-plugin-datalabels.netlify.com/samples/, where there is also a link to the documentation and the GitHub repository. The easiest way install it is with a CDN. Include the following code in ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro D3.js: Use D3.js to Create Maintainable, Modular, and Testable Charts

Pro D3.js: Use D3.js to Create Maintainable, Modular, and Testable Charts

Marcos Iglesias

Publisher Resources

ISBN: 9781789342482OtherErrata PagePurchase Link