6.7.8 Grouped Stacked Column
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:
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) .
- 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:
- 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.
- On the Label tab, check the Enable checkbox.
- 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.
- Click OK to close the dialog. Select Graph: Rescale to Show All from the main menu.
Steps to Create a Tick Label Table for X Axis
- 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:
- 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:
- 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.
- Double-click on the column plot to open the Plot Details dialog. On Group tab, click the button in the 'Details column of the Fill Color row. Increment Editor opens.
- 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.
- 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).
- 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.
- 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.
- Click the Spacing tab and increase the Gap Between Bars(in %) to 30.
- Select Layer1 in left panel of Plot Details dialog and click the Stack tab. Check the Show Total Label on Stacked Column/Bar.
- On the Group tab, change Edit Mode to Independent.
- Select the 4th plot in the left panel and click on the Label tab. Set Color to LT Gray. Click Apply button.
- 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.
- Select and delete the X and Y axis titles.
- 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.
- Select and drag the legend box to an appropriate position. Resize as needed, using the green selection handles.