Dual y-axis Charts
A dual y-axis chart allows you to summarize or plot two y-axis variables that have different domains. For example, you can plot the number of cases on one axis and the mean salary on another. This chart can also be a mix of different graphic elements so that the dual y-axis chart encompasses several of the different chart types discussed previously. It may display the counts as a line and the mean of each category as a bar.
How to create a dual y-axis chart with a categorical x axis
Note: The gallery includes samples of dual y-axis charts. The following steps use the basic elements so that you can generalize the steps for other varieties of dual axis charts.
- In the Chart Builder, click the Basic Elements tab.
- Drag the Dual y-axes icon onto the canvas.
- Drag the Bar icon onto the canvas. The first graphic element that you add to the canvas is used for the variable on the first y axis, which is the one on the left.
- Drag the Line icon onto the canvas. The second graphic
element is used for the variable on the second y axis, which is the one on the right.
Note: It is not required to use a bar and a line. You can use other graphic elements, but not all graphic elements are available in a dual y-axis chart.
- Drag a categorical variable to the x-axis drop zone. Both y axes default to Count. We will keep count as the statistic on the right-hand y axis.
- Drag a scale variable to the left-hand y axis. The statistic defaults to mean.
The resulting graph will display bars for the mean of the scale variable and a line for the count in each category. Note that you can use Element Properties to change the order in which the elements are drawn. For example, if the line were the first element, it may have been drawn behind the bars. You can use the Element Properties dialog box to ensure that the line is drawn last, on top of the bars. See the topic Editing graphic element properties for more information.
Additional features
Paneling. Paneling creates a table of charts, with a cell for each category in the paneling variable. See the topic Adding Paneling Variables for more information.