February 2019
Beginner to intermediate
284 pages
6h 20m
English
Currently, there is no native Chart.js way to show values or percentages in a pie chart without tooltips. But you can achieve this using a plugin or extension. In the following example, we will use a very simple library called Chart.Piecelabel.js. You can download it from github.com/emn178/Chart.PieceLabel.js and include it your page using a script tag:
<script src="../JavaScript/Chart.PieceLabel.js"></script>
That's it! Now you can add the pieceLabel property to the options object, and configure labels for the slices. You can display absolute values or percentages, place the labels inside, at the border or outside the slices, draw the text on the arc and configure several font attributes. The following is ...
Read now
Unlock full access