blob: 777facd689827579701ad9f522f12930ce247557 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{335:function(e,t,r){"use strict";r.r(t),t.default='# Stacked Bar Chart\n\nThe stacked bar chart is an extension of the bar chart. The difference is that the data in the bar chart is placed parallel while stacked together in the stacked bar chart. You can use a stacked bar chart to reflect the total amount of each category, as well as the proportional relationship of each data compared with the category. Therefore, it is very suitable for dealing with the relationship between part and whole.\n\nCompared with the pie chart, a stacked bar chart can display several groups of "part and whole" relationship. For instance, you can use a pie or bar chart to display the statistics of the number of people in each project in a physical education course. You can use a stacked bar chart when you want to distinguish boys and girls in each project. As shown in the chart, it included the info of the "part and whole" relationship of each group.\n\n<iframe max-width="830" width="100%" height="400" \n src="https://gallery.echartsjs.com/view-lite.html?cid=xBk7oUNwEz">\n</iframe>\n\n## Suggestion for Using Stacked Bar Chart\n\n1. Follow the basic rule of bar charts. Please avoid using too many colors so that the chart can be easily understood. Don\'t deliberately display partly data to mislead the user.\n\n2. A Stacked bar chart is not suitable for comparing data inside the group.\n\n3. While there are 2 or 3 categories, a stacked bar chart will show the best effect. It is not recommended to include more than 6 categories. Too many data series will also make it very difficult to read and understand.\n\n4. Try to avoid using a stacked bar chart with categories that included negative values. It will affect understanding or the proportion between part and whole.\n\n5. Most of the stacked bar charts are vertically generated. However, if you have very long labels, try to use the horizontal stack method. \n'}}]);