6.6.8 Variable Column Width

Summary

Origin allows you to specify a dataset to control column/bar width. When the Scaling Factor is 0, the dataset values determine bar width in terms of X axis scale values. Variable Column Width 07.png

Minimum Origin Version Required: Origin 2020

What will you learn

This tutorial will show you how to

  • Plot a stacked column graph
  • Set the width of column with a variable and add labels for the columns
  • Customize the axis ticks and tick labels

Steps

This tutorial is associated with the built-in graph sample Column and Bar Charts - Variable Column Width.

  1. Select Help: Learning Center to open the Learning Center. Select Graph Samples tab in the left panel of Learning Center and then enter the keywords "variable column width" to search the sample. You will got the sample listed as below:
    Variable Column Width 00.png
  2. Double-click on the graph icon to open this sample. In the opened project folder, activate the workbook Unit Sales (x1000) and Product Share, highlight col(B) and col(C) to select Plot > Bar, Pie, Area: Stacked Column from menu to plot a stacked column.
    Variable Column Width 01.png
  3. Click on the plot, and in the pop-up mini toolbar, under the Group tab, use the Fill Color button Popup Background Color.png to change the fill color of columns by plots with the specified palette Lit LT Purple . Of course, you can select other palette instead.
    Variable Column Width 02.png
  4. Double-click on the plot to open the Plot Details dialog. Go to the Spacing tab, select Col(D): "w" as Width (in %) and set Scaling Factor to <0=Use X Unit>.
    Variable Column Width 03.png
  5. Go to the Label tab, check the Enable check box, set Label Form to Col(D): "w" and Numeric Display Format to #%.
    Variable Column Width 04.png
  6. Click OK to close the dialog.
  7. Double-click on the X Axis to open the Axis dialog.
    • Select Horizontal icon in the Scale tab,set From and To to 0 and 1; under the Major Ticks branch, select By Custom Positions for Type and [Book8]Sheet1!A"Product Share (%)" for Position.
      Variable Column Width 05.png
    • Go to Tick Labels tab, and then under the Display sub-tab, set Type to Tick-indexed dataset and Dataset Name to [Book8]Sheet1!E"Item".
      Variable Column Width 06.png
    • Under the Format sub-tab, set Wrap Text to By Number of Characters and Wrap Minimum Width to 3.
      Variable Column Width 06b.png
    • Click OK to close the dialog.
  8. Double-click on the Y axis title and change it to Unit Sales. Click the white space of the layer, in the pop-up mini toolbar, click Layer Frame button Popup Layer Frame.png to add the layer frame.
    Variable Column Width 06a.png
  9. Right-click the legend box and select Properties... from fly-out menu. Edit the legend to display on one line. The graph should look like the following:
    Variable Column Width 07.png