6.6.6 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: 2020
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.
- Select Layer1 in left panel of Plot Details dialog and click the Stack tab. Check the Offset Within Subgroup(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 to rescale the layer.
- Click on the column, and in the popup mini toolbar, click the Show Data Labels under the Group tab to show the data labels on the columns.
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 [Book4]Sheet1!H in Display tab, and set the Font size to 12 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:
- Click OK button to close the dialog. Move the Legend box inside the layer. Click on the layer, and in the popup mini toolbar, click Layer Frame button to show the layer frame.
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 on the number (7) and (8) to left of the next color in the Increment Editor list separately, click Delete button to remove these 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, expand the Font control mini-panel, 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. Click OK button to close the dialog.
- Now, as you can see, the labels on the dark bars are hard to read. We need change their colors to make it "white out".
- Click on one of the labels of Ferrari Central plot as below to select the labels, in the popup mini toolbar, use Font Size and Font Color button to change its size to 11 and color to LT Gray.
- Click on one of the labels of Ferrari West plot to select the labels, in the popup mini toolbar, use Font Color button to change its color to LT Gray.
- 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.
- Resize as needed, using the green selection handles. Finally, you will get the graph as the Summary shows.