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

Preparing data for pie and doughnut charts

Pie charts can't be used with any type of data. They should only be used to display part-whole relationships and contain not much more than half a dozen data values. The following screenshot shows what happens when you create a pie or doughnut chart with too much data. In this example, we loaded a doughnut chart containing the populations of almost 200 countries. It may be art, but not really a useful visualization:

Abusing a pie chart (code: Pie/pie-4-evilpie.html; see also Pie/pie-6-evilpie.html)

Even if you reduce this dataset to less than 20 values, it would still not be efficiently displayed ...

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