6.10.6 Two-Level Grouped Box Chart


Summary

Origin’s box chart is advanced and customizable, this tutorials shows how to create a two- level grouped box chart from indexed data in Origin.

TwoLevelGroupedBoxChart0.png


Minimum Origin Version Required: 2015 SR0

What you will learn

This tutorial will demonstrate how to:

  • Use the data filter to select worksheet data.
  • Stack column for box chart.
  • Controlling the categorical values.
  • Create a grouped box chart from indexed data.
  • Customize box chart settings.
  • Customize the axis dialog for box charts.
  • Add a graph into box chart.

Data Preparation

This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj, so you should open Tutorial Data.opj and browse to the folder Two-Level Grouped Box Chart at first.

Using data filter to select worksheet data

In the following steps, you can select the data you want to analyze by data filter:

  1. Active the worksheet US Mean Temperature and then highlight Column B.
  2. Click the Add/Remove Data Filter button Button Add Or Remove Data Filter.pngon the Worksheet Data toolbar to add empty data filter to Column B.
  3. Click the Filter icon on the column header of Column B, clear the check boxes before Select All, and check CA, FL and TX again.
  4. Click OK to apply the filter.
    TwoLevelGroupedBoxChart1.png

Stacking columns to convert data into index mode

In the following steps, you can convert data from the raw mode into index mode:

  1. Highlight Column E to Column P (from January to December), and then select Worksheet: Stack Columns from the main menu to open the Stack Columns dialog
  2. Check the box before Include Other Column(s), click the Select from Worksheet button, and select Column A and B in the worksheet.
  3. Change the Group Column Long Name to “Month” and Data Column Long Name to “Temperature”
    TwoLevelGroupedBoxChart2.png
  4. Click OK to launch the new worksheet StackCols1
  5. Click the Lock icon on the column header, and select Recalculate Mode: None in the context menu.
    TwoLevelGroupedBoxChart3.png

Controlling the categorical values

In the following steps, you can customize the order of values shown in the graph but not change the source data:

  1. Highlight Column B in Worksheet StackCols1, and then right click to select Set as Categorical.
    TwoLevelGroupedBoxChart4.png
  2. Double click the Categories cell “unsorted” of Column B to open the Categories dialog.
  3. Uncheck the <auto> checkbox, and then specify the order of items into: CA-TX- FL by using Move to Top buttonCategory Tab Button ToTop 92.png, Move up buttonCategory Tab Button Move Up 92.png, Move Down buttonCategory Tab Button Move Down 92.png and Move to Bottom buttonCategory Tab Button ToBottom 92.png.
    TwoLevelGroupedBoxChart5.png
  4. Redo step2 and step3 in Column C to specify the order of items into: January to December.

Create a grouped box chart from indexed data

  1. Highlight Column D in Worksheet StackCols1, and then select Plot > Categorical : Grouped Box Chart – Indexed Data… in the main menu.
  2. In the open dialog Plotting: gboxindexed, click the triangle button at the top right corner in Groupe Column(s) section, and then select C(Y): Month and B(Y): State in order in the context menu item.
    TwoLevelGroupedBoxChart7.png
  3. Click OK to create a grouped box chart with two levels.
    TwoLevelGroupedBoxChart8.png

Customize box chart settings

  1. Select the graph layer (click somewhere in the lower-middle portion of the layer seems to work best ), and then drag the control handle to resize it as you want (put the cursor on the control handle, and drag it when the cursor becomes a two-headed arrow).
    TwoLevelGroupedBoxChart45.png
  2. Select Graph:Fit Page to Layers in the main menu to open the dialog, and then select Height Only in the drop-down list of Adjust Direction to match the page width to that of the bounding box.
    TwoLevelGroupedBoxChart40.png

    The graph will look like as below:
    TwoLevelGroupedBoxChart42.png
  3. Double click on any one of the boxes to open Plot Details dialog, go to Group tab. For both Border Color and Boxed Color, set Increment to By One and Subgroup to With Subgroup, so each subgroup has a different color. Click the color scale on the Details section, and select S01 Gray Scale in the drop down list for both Border Color and Boxed Color.
    TwoLevelGroupedBoxChart43.png
  4. Go to Pattern tab, uncheck the checkbox Follow the line transparency and set transparency to 30%.
    TwoLevelGroupedBoxChart12.png
  5. Go to Spacing tab to set the gap value between and within subgroup.
    TwoLevelGroupedBoxChart13.png
  6. Go to Box tab to set the range of box and whisker.
    TwoLevelGroupedBoxChart14.png
  7. Go to Percentile tab, clear the check box before the 99%, 1%, Max and Min, and then select the shape and size of Mean marker.
    TwoLevelGroupedBoxChart15.png
  8. Go to Line tab to customize the caps of whisker and uncheck the Median checkbox.
    TwoLevelGroupedBoxChart16.png
  9. Click OK button to apply the setting.
  10. Right-click the legend, and select Legend: Box Chart Components... in the context menu. In the ' Enhanced Box Legend: legendbox dialog, select State in the Box Indentifier dropdown list.
    TwoLevelGroupedBoxChart46.png

    The graph will look like as below:
    TwoLevelGroupedBoxChart17.png

Customize the axis dialog for box charts

  1. For the X Axis, change as the following steps:
    • Double click X Axis to open the Axis Dialog, and then select Bottom1 on the left panel
    • Go to Tick Labels tab, set the font size of Bottom1 with 14 in Format tab, and duplicate settings as shown below in Table tab.
      TwoLevelGroupedBoxChart18.png
    • Select Bottom2 on the left panel, uncheck the <Auto> checkbox and set the font size of Bottom2 with 11 in Format tab, and duplicate settings as shown below in Table tab.
      TwoLevelGroupedBoxChart19.png

    The elements of table layout are shown as below:

    TwoLevelGroupedBoxChart44.png

    • Go to Line and Tick tab, and change the style of major ticks into In.
      TwoLevelGroupedBoxChart20.png
  2. For the Y Axis, change scale, title, font size of label tick and the style of ticks as shown below:
    TwoLevelGroupedBoxChart21.png
    TwoLevelGroupedBoxChart22.png
    TwoLevelGroupedBoxChart23.png
    TwoLevelGroupedBoxChart39.png
  3. Hide the top and right axis of the plot:
    Press CTRL and select both Top and Right in the left panel, and then go to Line and Ticks tab to uncheck Show Line and Ticks.
    TwoLevelGroupedBoxChart24.png
  4. Click OK to apply your setting.
  5. Select Legend and press Delete to remove it, the graph should appear as below
    TwoLevelGroupedBoxChart26.png

Add a graphical symbol of the box into box chart

If you want to add a graphical symbol of to tell the meaning of each line in box, you can follow these steps:

  1. Active Workbook US Mean Temperature, right click the label of worksheet below and select Add to add a new worksheet into workbook.
  2. Enter 1 to 5 in each row respectively in Column A.
    TwoLevelGroupedBoxChart27.png
  3. Highlight Column A and then select Plot > Statistical: Box Chart to create a simple box chart.
    TwoLevelGroupedBoxChart28.png
  4. Double click the plot to open the Plot Details dialog.
  5. To object Graph2, set the width and height of page on Print/Dimension tab.
    TwoLevelGroupedBoxChart29.png
  6. To object Layer1 , go to Size/Speed tab and set the size of Layer1.
    TwoLevelGroupedBoxChart30.png
  7. To object box, go to Pattern tab and set as shown below.
    TwoLevelGroupedBoxChart31.png
  8. Go to Percentile and Line tab, and select the same setting of grouped box chart Graph1.
    TwoLevelGroupedBoxChart32.png
    TwoLevelGroupedBoxChart33.png
  9. Go to Box tab, check the box before Box Label, Whisker Label and Mean Value Label, and shown them in Percentile, and then change the width of box into 20%, besides set the range of box and whisker.
    TwoLevelGroupedBoxChart34.png
  10. Click OK to apply your setting.
  11. Select and delete X axis, Y axis, Y axis title Range and Legend of Graph2.
    TwoLevelGroupedBoxChart35.png
  12. Press CTRL + C in Graph2, and then press CTRL + V in Graph1 to copy the graphical symbol into the box chart.
  13. Select the graphical symbol in Graph1, and then resize it and move it to a nice location.

At last, you will get the final graph.

TwoLevelGroupedBoxChart0.png