6.7.8 Grouped Stacked Column


Summary

In Origin, multiple datasets can be plotted as a stacked column graph. Usually these datasets are grouped together by default. In addition, subgrouping is possible for stacked column graphs such as the one shown below with 2 subgroups:
Grouped Stacked Column 08.png

Minimum Origin Version Required: 2017 SR0

What will you learn

This tutorial will show you how to:

  • Plot a stacked column graph
  • Subgroup the stacked column
  • Create and customize an X axis table for the graph

Steps to Create a Grouped Stacked Column Plot

This tutorial is associated with the Grouped Stacked Column folder in the project <Origin EXE Folder>\Samples\Tutorial Data.opj.

Note: You can also access this sample graph by double-clicking on its thumbnail under the Column and Bar graph sample in the Learning Center dialog(Help: Learning Center menu or press F11) .

  1. Activate the worksheet Sheet1, highlight col(B)~col(G) and select Plot > Basic 2D: Stacked Column from the menu to create a stacked column graph:
    Grouped Stacked Column 01.png
  2. Double-click on the column plot to open the Plot Details dialog. On the Group tab, select By Size for Enable subgroup and set Subgroup Size to 3.
    Grouped Stacked Column 02 2.png
  3. On the Label tab, check the Enable checkbox.
    Grouped Stacked Column 03 2.png
  4. Select Layer1 in left panel of Plot Details dialog and click the Stack tab. Check the Use Subgrouping (in Group tab) for Cumulative/Incremental check box. Click the Apply button.
    Grouped Stacked Column 05.png
  5. Click OK to close the dialog. Select Graph: Rescale to Show All from the main menu.
    Grouped Stacked Column 01 2.png

Steps to Create a Tick Label Table for X Axis

  1. To create two rows of tick labels for the X axis, double-click on the X axis tick labels to open the Axis dialog.
    • Go to Bottom icon with Tick Labels tab selected.
    • Under Format tab, change Font Size to 16
    • Under Table tab, check the Enable checkbox and set Number of Rows to 2. Bottom icon will change into Bottom 1 and Bottom 2 on the left panel.
    • Set the Table layout as shown below:
      Grouped Stacked Column 06.png
    • Select the Bottom 2 icon and set Dataset Name to [Book1J]Sheet1!label in Display tab, and set the Font size to 10 in the Format tab. This will change the tick label row to the car names from the worksheet label (Y) column.
    • Set the table layout as the dialog below:
      Grouped Stacked Column 07.png
    • To show a frame around the layer, select the Grids tab, Check on the Opposite check box under the Additional Lines branch and click OK button for both Horizontal and Vertical icons.

More Customization Steps

The following steps can further customize the graph to be exactly the same as the image in Summary.

  1. Double-click on the column plot to open the Plot Details dialog. On Group tab, click the Button browser.png button in the 'Details column of the Fill Color row. Increment Editor opens.
  2. Click on the arrow to the right of the first color, then click on an empty color well under Custom. In the Color dialog that opens, set the Red, Green and Blue values to 165, 196 and 0, then click OK.
  3. Create five more custom colors using these RGB values: (243, 62, 12), (243, 200, 30), (0, 64, 127) (119, 0, 31), and (124, 191, 243).
  4. Click the number (7) to left of the next color in the Increment Editor list, then scroll to the bottom of the list, press Shift then click on the number to the left of the last color. Click Delete to remove the selected colors so that you have just the six custom colors that you just created. Click OK to close the Increment Editor.
    Grouped Stacked Column 02.png
  5. On the Label tab, set Size to 12, Color to Dark Gray and click on the Bold button. Choose Custom as Label Form and enter $(p,.0)% in Format String box. This adjusts the labels on the columns.
    Grouped Stacked Column 03.png
  6. Click the Spacing tab and increase the Gap Between Bars(in %) to 30.
    Grouped Stacked Column 04.png
  7. Select Layer1 in left panel of Plot Details dialog and click the Stack tab. Check the Show Total Label on Stacked Column/Bar.
    Grouped Stacked Column 09.png
  8. On the Group tab, change Edit Mode to Independent.
  9. Select the 4th plot in the left panel and click on the Label tab. Set Color to LT Gray. Click Apply button.
  10. Select the 5th plot in the left panel, and on the Label tab change Color to LT Gray and Size to 11. Click OK to close the dialog.
  11. Select and delete the X and Y axis titles.
  12. Right-click on en empty portion of the graph window and select Add/Modify Layer Title from the context menu. Type Sales as a layer title.
  13. Select and drag the legend box to an appropriate position. Resize as needed, using the green selection handles.