Last updated: Apr 26, 2024
Bar charts are useful for summarizing categorical variables. For example, you can use a
bar chart to show the number of men and the number of women who participated in a survey. You can
also use a bar chart to show the mean salary for men and the mean salary for women.
Creating a simple bar chart
- In the Chart Type section, click the Bar
icon.
The canvas updates to display a bar chart template.
- Select a categorical (nominal or ordinal) variable as the Category variable. You can use a scale variable, but the results are useful in only a few special cases. A bar chart looks best with a limited number of distinct values. If you create a bar chart with a scale Category axis, the bars are thin because each bar is drawn at an exact value, and the bar cannot overlap other continuous values.
- Select a statistic from the Summary list. The result of any statistic determines the height of the bars. If the statistic you want does not appear in the Summary list, it might require a variable. Select a variable from the Value list and check if the statistic is now available. Other chart type limitations might exist. For example, error bar charts can be calculated only for specific statistics.
- Click the Save visualization in the project control. Select Create a new asset or Append to existing asset. Provide a Visualization asset name, an optional description, and a chart name.
- Click Apply to save the visualization to the project. The new visualization asset is now available on the Assets tab.
Options
- Category
- Lists variables that are available for the chart's X-axis.
- Order based on
- Select a sorting option for the categories within the variable.
- Category name
- Use the category labels for sorting the variable's categories. The labels appear in the chart, usually as tick or legend labels.
- Category value
- Use the value that is stored in the data set for sorting the variable's categories. The category's value is what identifies the category in the data set. It often differs from its label and is not necessarily descriptive. For example, the value might be a number (for example, 1), while the label is a text description of the category (for example, Female).
- Category order
- Select the order in which variable categories are sorted.
- As read
- Variable categories are presented as they appear in the data set.
- Ascending
- Sort variable categories in ascending order.
- Descending
- Sort variable categories in descending order.
- Summary
- Select a statistical summary function for the graphic element. The result of the statistic
determines the position of the graphic elements on the Y-axis. In a 2-D chart, the statistic is
calculated for each value on the X-axis. In a 3-D chart, it is calculated for the intersection of
values on the X-axis and Z-axis.Two types of statistical summary functions are available. The distinction is important because it determines whether you need to specify a Value variable.
- Functions that do not require a value variable. Functions that do not require a variable. All count and percentage statistics are in this category. These statistics are available when the Value variable is not defined.
- Functions that do require a value variable. Functions that do require a Value variable. For example, the Mean function requires a variable on which the mean is calculated. These statistics are available when the Value variable is not defined.
- Value
- This field displays when a Summary function that requires a value variable, is selected. Select a variable to serve as the value.
- Split by
- Select a categorical variable that creates a table of charts, with a cell for each category in the Split by variable. Like grouping, split by variables essentially add more dimensions to your chart by displaying information for each variable category.
- Split type
- When a Split by variable is selected, you can choose to display the resulting category bars as either stacked or clustered. Clustering and stacking add dimensionality within the chart. Clustering splits one bar into multiple bars, and stacking creates segments in each bar. Be careful that you choose the right statistic for stacking. When the values are added (stacked), the result must make sense. For example, adding and stacking mean (averaged) values is not usually meaningful.
- Bar type
- Select the bar chart type from the provided options.
- X-axis
- Y-axis
- X-axis inverse
- Y-axis inverse
- Polar-angle axis
- Polar-radius axis
- Polar-rainbow
- Label position
- Select the chart's label position from the drop-down menu.
- none
- top
- left
- right
- bottom
- inside
- insideLeft
- insideRight
- insideTop
- insideBottom
- insideTopLeft
- insideBottomLeft
- insideTopRight
- insideBottomRight
- Show reference line
- The toggle control enables and disables the display of reference lines in the chart. Available options are Min, Max, and Average, which display reference lines at the chart's minimum, maximum and average values.
- Enter a reference line value
- When Show reference line is enabled, this setting provides the option of specifying a reference line value. Click Add another column to specify more reference line values.
- Transpose
- When enabled, the chart's X and Y axes are transposed.
- Primary title
- The chart title.
- Subtitle
- The chart subtitle.
- Footnote
- The chart footnote.
- XAxis label
- The x-axis label.
- YAxis label
- The y-axis label.