Bar charts use either vertical or horizontal bars to show comparisons among categories. One axis shows specific categories (typically, dimensions), while the other axis represents discrete values (measures). Bar charts are good for avoiding clutter when data labels are long, or when comparing a large number of items, typically more than 10. Bar charts can also display negative numbers.
After learning how to construct a basic bar chart, explore some additional uses for bar charts, including:
The following steps demonstrate how to create a new bar visual representation on dataset
World Life Expectancy [data source
World Life Expectancy[data source
samples.world_life_expectancy]; see Creating Visuals.
In the visuals menu, find and click bars (row 1, column 3).
Note that the shelves of the visual changed. They are now X, Y, Colors, Tooltips, and Filters.
The mandatory shelves for bar visuals are X and Y, representing the X-axis and Y-axis.
Populate the shelves from the available fields (Dimensions, Measures, and so on) listed in the left navigation menu.
countryand drag it over X shelf on the main part of the screen. Drop to add it to the shelf.
life_expectancyand drag it over Y shelf on the main part of the screen. Drop to add it to the shelf.
On the shelf of the visual, on
sum(life_expectancy) field, click the icon (down arrow), select Aggregates, and then select Average.
Note that the shelf now contains the modified field
Click Refresh Visual.
The bar visual graph appears.
On the shelf, on
country field, click the icon (down arrow), select Alias, and then select Set.
In the Enter a column alias modal window, enter Country.
On the shelf, on
life_expectancy field, click the icon (down arrow), select Alias, and then select Set.
In the Enter a column alias modal window, enter Life Expectancy.
To see the bars as different colors, you must place
country field on the Colors shelf.
Country field, click the icon (down arrow), then select Duplicate.
Click one of the
Country fields on X shelf, drag it to the Colors shelf, and drop it.
[Optional] On the Tooltips shelf, add several fields from Dimensions and Measures.
This enables you to see specific descriptive information in your visuals, such as input values, segment affiliation, and calculations.
gdp_per_capitaonto the Tooltip shelf.
un_regiononto the Tooltip shelf.
For all numeric items on the Y shelf and the Tooltip shelf, click the icon (down arrow), select Display Format, and enter
Note that these fields are typically from the Measures menu, and in this example include
[Optional] On the Filters shelf, add several fields from Dimensions and Measures.
This enables you to dynamically control the data input, and discover the data at a more granular level.
For example, from Dimensions, drag
year onto the Filters shelf.
Click Edit next to the title of the visualization.
Change the title to
World Population - Bars.
Above the left navigation bar, click Save.