This article describes how to show data from variables or two different types of tables: summary tables with a single column and crosstabs with multiple columns, like these:
To bar charts like these:
Requirements
A Displayr document with at least one of the following:
- A table with one or more columns, OR
- At least one variable or variable set with the following structure
- Nominal - Mutually exclusive categories structure, OR
- A Date/ Time variable, OR
- A multiple-response variable set structured as a Binary - Multi: Non-mutually exclusive categories
Please note this requires the Data Stories module or a Displayr license.
Method: from the visualization menu with a single column table or one variable
1. Select the Visualization icon > Bar > Bar.
2. Click on the page to place the visualization.
3. Under Data > DATA SOURCE > Output in 'Pages' select the table that you want to base the chart on. Alternatively, select a nominal or date/time variable in the Variables in 'Data'.
4. OPTIONAL: If Variables in 'Data' is selected, tick Convert to Percentages/Proportions under DATA MANIPULATION.
5. Click Calculate and/or ensure that Automatic is checked.
Method: from the visualization menu with a multi-column table or two variables
1. Select the Visualization icon > Bar > Bar.
2. Click on the page to place the visualization.
3. Under Data > DATA SOURCE > Output in 'Pages' select the table that you want to base the chart on. Alternatively, select a nominal or date/time variable in the Variables in 'Data' and a second variable in the Groups drop-down.
4. OPTIONAL: If Variables in 'Data' is selected, tick Convert to Percentages/Proportions under DATA MANIPULATION.
5. In COLUMN MANIPULATIONS > Columns to show enter the label or index of the column. In the example above, "Diet Coke" was entered. Alternatively, the number 2 could have been entered(the index of the second column on the table).
6. Click Calculate and/or ensure that Automatic is checked.
Method: from an existing single column table
1. Select the table.
2. From the object inspector, go to > Bar > Bar.
3. Click Calculate and/or ensure that Automatic is checked.
Method: from an existing multi-column table
1. Select the table.
2. From the object inspector, go to > Bar > Bar.
3. Under Data > DATA SOURCE > COLUMN MANIPULATIONS > Columns to show enter the label or index of the column. In the example above, "Diet Coke" was entered. Alternatively, the number 2 could have been entered (the index of the second column on the table).
4. Click Calculate and/or ensure that Automatic is checked.
Options
The following is an explanation of the options available in the Object Inspector for this specific visualization. Refer to Visualization Options for general chart formatting options.
Chart
APPEARANCE
- Gap between bars - Specify the amount of space between bars as proportion of the available space. Values can range from 0 (no gaps) to 0.99 (bars are shown as lines).
DATA LABELS
- Minimum threshold to show data labels - Data labels will be hidden in Stacked charts for values which are smaller than this proportion of the total range.
Note
Important information about editing captions:
Visualization caption edits may not be retained when a visualization with a nested table is switched back to the table. Normally, this only occurs when you double-click the caption and edit the text directly. As a workaround, we recommend using Appearance > CAPTION > Edit caption to edit your captions.
Next
How to Create a Clustered Bar Chart
How to Create a Stacked Bar Chart
How to Create Several Bar Charts Using Small Multiples
How to Customize the Color of a Single Category in a Bar, Column, or Pyramid Visualization
How to Apply a Gradient Palette to a Bar, Column, or Pyramid Visualization