Bar chart is one of the most commonly used chart type that will help us quickly compare information across various categories. In a bar chart, the height (in the case of a vertical bar chart) or the length (in the case of a horizontal bar chart) of the bar is what determines the value. They are very effective when we want to split our quantifiable data into different categories and find quick trends in the data, for example, the number of sales across different customer segments, the profit across various product categories, and so on. The bar chart in Tableau uses the Bar mark type.
In the following recipe, we will continue working in our existing workbook to create a bar chart that shows the sales across different regions. We will use the Sales field from the Measures pane and the Region field from the Dimensions pane. Let's see how this is done.
Bar chart
.In the first chapter, we read about the Rows and Columns shelves. Since we place Region in the Columns shelf, we get a column for each region; Sales in the Rows shelf creates the y axis.
This is because a continuous field, such as Sales, will result in an axis being drawn when placed in the Rows or Columns shelf. However, a Discrete field, such as Region, will result in the headers being drawn when placed in the Rows or Columns shelf.
We could have also created the same bar chart using the Show Me! button, and to do this, we simply have to select Region in the Dimensions pane and do a Ctrl + Select on Sales in the Measures pane first. Then, click on the Show Me! button to select the Bar chart option, which is already highlighted with a Brown border. Refer to the following image:
Once we select the Bar chart option from Show Me!, we will get a horizontal bar chart that can be made vertical by swapping the Rows and Columns shelves by clicking on the Swap button in the toolbar. Refer to the following image:
18.191.195.111