February 2019
Beginner to intermediate
284 pages
6h 20m
English
When you have a lot of data to display and compare, it might fit better in a horizontal bar chart. You can easily convert a vertical bar chart into a horizontal one by changing the type to horizontalBar, as follows:
new Chart(ctx, { type: "horizontalBar", data: {…}}
The preceding chart seems better as a horizontal chart, since the category labels don't have to be turned sideways. You can see the full code in Pages/BarChart10.html. The following screenshot shows what the chart looks like now:

Read now
Unlock full access