*** ## description: Stacked Bar Chart # Stacked Bar Stacked bar charts display values for one or two dimensions, one of which must be defined on the x-axis. Measures are displayed as the height and color of the bar for each dimension group. With stacked bar charts, you can display multiple measure/dimension combinations on each bar. This makes it easy to visually compare measures for the defined dimensions, as well as see the cumulative value for the defined measure.
FeaturesQuantityNotes
FeaturesQuantityNotes
Dimensions1-2String values for X axis (required) and color (optional). Standard deviation (stdev) does not work when using the color dimension.
Required Measures1
You can convert Stacked Bar charts to the New Combo chart format. For more information, see [New Combo charts](/immerse/immerse-chart-types/new-combo#duplicating-and-upgrading-other-chart-types-to-new-combo-charts). ## Stacked Bar Chart Examples The following examples use the *flights\_2008\_7M* sample database. Stacked Bar charts use two dimensions (X axis and color) and one measure. 1. Create a new Stacked Bar chart. 2. Choose **flights** as the **Data Source**. 3. For **Dimensions**, select destination state for **X Axis** and origin state for **Color**. To remove the null dimension on the X Axis, toggle **Null Dimensions** to off. **Note:** * If you omit the **Color** dimension, you create a single-color vertical bar chart. * When you use the **Color** dimension, Immerse selects the top five categories for the dimension and measure. When the **All others** toggle is on, all categories not in the top five are shown as **Other**. 4. For **Measures**, select the sum of airtime. 5. Sort by descending airtime, and define the colors for origin states. **Note:** You can enable and disable All Others **Color Palette**, but you cannot add or remove categories. This creates a chart like the following, showing the cumulative airtime for flights, based on origin state and destination state. The origin state airtimes are stacked on the same bar, making it easy to see total airtime by destination as well as total destination airtime by individual origin. ![](https://files.buildwithfern.com/heavyai.docs.buildwithfern.com/heavyai/6d3e1a5e35fc696e92c956dca76ee66f50c7c594e06525ba33d588a92b4d3d59/docs/assets/SS_103.jpg) Now, adjust the chart dimensions and measures to see information about cancelled flights for particular origination cities for individual airlines. 1\) For **Dimensions**, select origin city for **X Axis** and select carrier name for **Color**. 2\) For **Measures**, select the sum of cancelled flights. This creates a chart that shows the total cancelled flights for particular origin cities, broken out by air carrier. ![](https://files.buildwithfern.com/heavyai.docs.buildwithfern.com/heavyai/2b6b058093ed043c7d6a342fd777396ab7eccfefbdf0b9fe125cbb1c3af4782b/docs/assets/SS_104.jpg) If you prefer, you can set the **Percentage View** toggle to compare relative values within a dimension and side-by-side. ![](https://files.buildwithfern.com/heavyai.docs.buildwithfern.com/heavyai/97baf297e346830a84817e240b346c63db4179b3545ae9bf4549d7aa12c66a62/docs/assets/SS_105.jpg) You can reduce the number of cities on the X Axis by sliding the **# of Groups** down (**15** in the next example), and show the value for all other airlines by toggling **All Others** to **On** in the **Color Palette**: !\[]\(../../../../../assets/SS\_106 (1).jpg) In some cases, if you disable All Others from the color menu, the # of Groups does not match what is shown on the x axis. For example, in the following chart, the number of X axis items for dest\_state is five, but the # of Groups is set to **6**. ![](https://files.buildwithfern.com/heavyai.docs.buildwithfern.com/heavyai/40fd03ebd3fb232d6b19d0490c2b6d3ea42d5556ddff0d291d472dc0e7f2f5e1/docs/assets/SS_107.jpg) This occurs because the query that is returned has "undefined" for "key1" values, and these values are filtered out by Immerse. When the **All Others** toggle is enabled, these values are referred to as "other" instead and are grouped together, making the number of values on the X axis match the number defined in **# of Groups**. !\[]\(../../../../../assets/SS\_108 (1).jpg)