Example: creating a clustered bar chart from basic elements
Following are the steps that you would complete to create a clustered bar chart from the basic elements. It is easier to create the same chart from the gallery because the settings in the gallery chart allow you to skip some steps. The example is intended to demonstrate how you use the basic elements if you need to create a chart that doesn't appear in the gallery.
Add the axes and graphic element
- Click the Basic Elements tab.
- Drag and drop the Bar icon onto the canvas. Adding the graphic element automatically adds a default axis set.
Add the variables
- Select a categorical (nominal or ordinal) variable from the Variables list and drag it into the x-axis drop zone. The categories in this variable determine the categories that appear on the x axis. Without clustering, one bar would be drawn for each category. With clustering, one cluster of bars will be drawn for each category. The number of bars in each cluster is determined later on when you add the clustering grouping zone.
- Select a scale variable from the Variables list and drag it into the y-axis drop zone. Alternatively, you could have kept the default Count statistic. Note that the Chart Builder defaults the summary statistic to Mean when you add the scale variable to the y axis. You will change it in this example.
Change the summary statistic
- Click the Element Properties tab in the side bar to display the element properties. (If the side bar is not displayed, click the button in the upper right corner of the Chart Builder to display the side bar.)
- Bar1 should be selected in the Edit Properties Of list. If it isn't, select it.
- From the Statistic drop-down list, select Median.
Add clustering
- Click the Groups/Point ID tab.
- Select Cluster on X. Note that a new drop zone appears on the canvas.
- Drag a categorical variable from the Variables list to the Cluster zone. In each cluster, one bar will be drawn for each category in the variable. Depending on your style cycle preference, each bar is distinguished by color or pattern. You can change this specific instance by double-clicking the grouping zone. To change the default, choose Options from the Edit menu in the Data Editor. Then click the Charts tab and modify the Style Cycle Preference setting.
Finish
- Click OK in the Chart Builder dialog box to create the clustered bar chart that you specified.