Horizontal bar chart

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:

A horizontal bar chart (code: Pages/BarChart10.html)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset