Bar charts summarize and compare categorical data. Understanding relative differences between numbers is much easier when those numbers are represented visually. We are good at perceiving length and position, so using bars to represent numbers is a powerful way to compare and rank values associated with categorical data.
Bar charts are composed of an x-axis and a y-axis. The x-axis assigns one bar for each category or date. Each bar's height corresponds to a value, which is measured by the y-axis.
If the values in the category variable are unique (only in the attribute field once), no aggregation is necessary. For example, if the category variable is StateName and the table only has one record for each state, no aggregation is needed.
If the category values repeat in the table, an Aggregation method must be chosen. For example, if the category variable is StateName for a county dataset, each StateName is in the table multiple times, so aggregation may be desired if you want a chart showing amounts per state.
The aggregation method can be one of the following:
- COUNT—The number of times each unique category appears in the category field
Bar chart series can be defined from one or more value fields on the y-axis or from one value field split into series by a second category field.
From one or more fields
Each bar's height corresponds to a numeric value. In a chart with a COUNT Aggregation method, no numeric value field needs to be specified because the value corresponds to how many records fall into each category. For example: the category variable is set to StateName for a county dataset with a COUNT Aggregation method. The resulting chart will display one bar for each state, and the bar heights will represent how many counties belong to each state.
Other times, the numeric value corresponding to the bar's height will come from a field in the attribute table. This field can be specified in the Series table by selecting it from the Fields list. If each category is represented in the table only once, no Aggregation method is necessary. If the category value is repeating, an Aggregation method must be chosen to summarize the multiple value. For example, the category variable is set to StateName for a county dataset with a SUM Aggregation method and a Population2010 Fields value. The resulting chart will display one bar for each state, and the bar heights will represent the sum of all the Population2010 values for each county in the state.
Additional Fields can be chosen to create a chart with multiple series. For example: the category variable is set to StateName for a county dataset with a SUM Aggregation method and two Fields values, Population2010 and Population2015. The resulting chart will display two bars for each state; one bar will represent the sum of all the Population2010 values for each county in the state, and the second will represent the sum of all the Population2015 values for each county in the state.
From one field split into series
Each category in a bar chart can also be split into multiple series by another category field's values. For example: the category variable is set to StateName for a county dataset with a COUNT Aggregation method and a Split by field of ElectionWinner. The Series table will populate with each unique ElectionWinner value and the resulting chart will display two bars for each state with heights corresponding to the number of counties that fell into each Split by category (Democrat, Republican).
Additionally, a Number value can be specified to determine each bar's height. For example, the category variable is set to StateName for a county dataset with a SUM Aggregation method, a Population2015 Number value, and a Split by field of ElectionWinner. The resulting chart will display two bars for each state with heights corresponding to the sum of all the Population2015 values for each county of each ElectionWinner category (Democrat, Republican).
Category fields with many unique values are not appropriate for splitting a field into multiple series.
Display multiple series
When a bar chart contains multiple series they will be displayed as side-by-side bars by default. When the multiple series represent a part-to-whole relationship (i.e., all of the series combined add up to 100% of the category) they can also be represented using stacked bars or 100% stacked bars.
Side by side bars are best for comparing the individual values of each series across different categories. Stacked bars are best used when you are more interested in the totals for each category, but would like a sense of their series breakdown. 100% Stacked bars are used when you are only interested in visualizing the part-to-whole relationship without absolute totals.
Bars can be drawn horizontally by checking on Rotate chart.
Default y-axis bounds are set based on the range of data values represented on the y-axis. These values can be customized by typing in a new desired axis bound value. Setting a y-axis bound can be used as a way to keep the scale of your chart consistent for comparison. Clicking the reset icon will revert the axis bound back to the default value.
Since bar charts use length to represent relative value, it is important that all bar charts include an origin of zero.
You can format the way an axis will display numeric values by specifying a number format category or by defining a custom format string. For example, $#,### can be used as a custom format string to display currency values.
Titles and description
Charts and axes are given default titles based on the variable names and chart type. These can be edited on the General tab in the Chart Properties pane. You can also provide a chart Description, which is a block of text that appears at the bottom of the chart window.
When a chart window is active, a Chart Format context ribbon becomes available, allowing visual formatting of the chart. Chart formatting options include the following:
- Changing the size, color, and style of the font used for axis titles, axis labels, description text, legend text, data labels, and guide labels
- Changing the color, width, and line type for grid and axis lines
- Changing the background color of the chart
Bar charts are automatically sorted alphabetically by their categories (x-axis ascending). This can be changed using the Sort options in the chart window. Four options are available:
- X-axis Ascending—categories are arranged alphabetically from left to right.
- X-axis Descending—categories are arranged in reverse alphabetical order.
- Y-axis Ascending—bars are arranged by value (height) from smallest to largest.
- Y-axis Descending—bars are arranged by value (height) from largest to smallest.
Bar charts with no aggregation or grouping match the outline and fill colors defined in the layer symbology. Once an aggregation or grouping is applied, it is no longer possible to use the layer symbology colors and a standard color palette will be applied. Colors can be changed by clicking the Symbol color swatch in the Series table and choosing a new color.
Labels displaying the value of each bar or series can be toggled on or off using theData Labels button in the chart window.
Guide lines or ranges can be added to charts as a reference or way to highlight significant values. To add a new guide, navigate to the Guides tab in the Chart Properties pane and click Add guide. To draw a line, enter a Value where you would like the line to draw. To create a range, enter a to value. You can optionally add text to your guide by specifying a Label.
Create a bar chart to compare median vacation rental prices across neighborhoods in New York City by room type.
- Category or Date— Neighborhood
- Aggregation— MEDIAN
- Series > From one field split into series
- Number— Price
- Split by— Room type