Independence Day OFFER : Learning is Freedom, Get FLAT 25% OFF  INDEPENDENCE25

- Tableau Blogs -

# Tableau Bar Chart - How to Create one?

### Introduction

The tableau bar chart has always been one of the most common and effective charts preferred for data visualization. Be it for comparison data or for showing the frequency, the tableau bar charts have always been instrumental.

In this post, we’re going to talk about the following-

• What is a bar chart
• When we should create a bar chart
• how to create bar charts
• Formatting a bar chart

At the end of this post, you will be able to understand why bar chart is so required in the field of data visualization. And also, the do’s and don’ts of the bar chart.

## What are Bar Charts- Tableau Essential you need to know?

If you have seen something like below-

Yes, that’s a bar chart.

Tableau bar charts are a form of data visualization chart which help us show the frequency of the data corresponding to a categorical variable.

For example, if we have to show the sales in each category of the population in different states, for all such situation, a bar chart can be an ideal solution. Usually, you will find the developers using bar chart for the generic uses as well. Like they have the data and need to show that using graphs and in such cases, bar chart is the generic solution.

Although this can be somewhat true up to some extent, it cannot be the same all the time. And so, you should understand when to use the tableau bar charts and when not.

This is what tableau bar charts are!

Tableau Online Training & Certification

• Detailed Coverage
• Best-in-class Content
• Latest Technology Covered

### When you should create a bar chart?

Bar charts are majorly created when we have-

1. A categorical variable
2. A numerical variable

So, usually we keep the categorical data on one axis and their corresponding frequency or values will be showing on the other axis.

As for example, in our previous section, we can make state on x-axis and population on y-axis. And the same for the other example where we can keep category on x-axis and sales values on the y-axis.

If we talk about the functional requirement then in below scenarios, we can a bar chart to represent our data-

1. When we need to show the frequency of certain categories
2. When we want to compare one category with the other category

Although these can’t be the only scenarios when we should use the bar chart. Even if we have continuous data at both the axis also, we can use but that will be either using BINS or using histogram which is similar to a bar chart.

Now as we understand, what is a bar chart and when to create it, let’s work and see how to create those.

Read: Tableau vs. Qlikview vs. Power BI - Comparing Data Management Tools

Tableau Online Training & Certification

• No cost for a Demo Class
• Industry Expert as your Trainer
• Available as per your schedule
• Customer Support Available

### How to create bar charts?

Creating bar chart is easy and can be done by using a dimension and a measure. Although even a single measure should be sufficient to create a bar chart.

Bar charts are of two types-

1. Vertical bar chart
2. Horizontal bar chart

Vertical bar chart is the default and when we say bar chart, that usually refers to the vertical bar chart.

Take our online Tableau training and become a Tableau pro in no time.

#### #1 Vertical Bar chart

To create a vertical bar chart, we can keep a dimension to columns shelf and a measure to the rows shelf.

For example, let’s say we want to create a vertical bar chart for category vs sales.

To do that, we can drag and put category dimension to the columns shelf and drag the sales measure to the rows shelf.

If you want to enable the text to show the sales values, just click on the text value or enable the label from the Marks shelf.

#### #2 Horizontal Bar Chart

Horizontal bar chart is similar to the vertical bar chart and the difference is having the dimension to the y-axis. Usually, we create the horizontal bar chart when we have labels with more characters.

To create the horizontal bar chart, we can simply swap the rows and columns. This can be done by using the swap option or just pressing ctrl + W.

There is another option to create the horizontal bar chart as well. And that can be done using the show me tab. You can drag the required dimension and measure and then select the horizontal bar chart option from the show me tab.

Read: The Ultimate Beginner’s Guide To Data Visualization Tools Tableau

#### Stacked Bar Chart

Multiple times we come across a situation when we need to go a little deeper in the bar chart. For example, let’s say we created a bar chart for category vs sales as we have done earlier. And then further we want to explore the contribution.

The contribution made by each segment in each category. This is similar like if a person earns \$1000 then which field contributes how much. It can be like his salary is giving \$800, a rental might be \$100, and other income might be \$100. Combining all these are making \$1000.

Whenever we need these kind of analysis, stacked bar chart can be very helpful. Let’s see how we can create stacked bar chart in tableau.

Requirement: We need to create a stacked bar chart where the bar chart is in-between category vs sales stacked on segment.

To implement this, first create a vertical bar chart for category vs sales as we have done earlier-

And as we need to stack this chart on the basis of segment and so, drag the segment dimension and put it in the color shelf-

Now you will find your graph has been stacked with segment and now the category has been further stacked on segment-

#### Tableau Side by Side Bar Charts

This is another variant of the Tableau bar charts where we need to create separate charts for all the categories. The way we have done in stacked bar chart, it will be done on similar way. In Tableau side by side bar chart is directly available in the show me options and can be created just by selecting it. This type of bar chart can be used for comparing the value corresponding to the one or more dimension. Usually, more than one dimension. For example, if we have to compare the values of state vs sales and at the same time also corresponding to the month, we can use side by side chart. Here it will be shown as we are seeing monthly sales data for each state. And this can be a good factor to find out how sales is dependent in our case.

Once Tableau side by side bar chart selected in the above requirement, it will be shown like below-

#### Tableau Bar Chart Formatting

Bar chart can be formatted on the following options-

• Color
• Size
• Text
• Alignment and others

We can make changes to color to the chart just by selecting the color shelf in the Marks section. Just select the color as per your choice-

Similarly, we can make changes on the size. This can also be done from the marks shelf itself. Just resize the bar as per the requirements. Make sure, when you’re increasing the size, it should not be overlapped. Means while making the bar bigger, your bars may be overlapping each other which should not be the case. While making the size small, there may be a gap of too much which must not be the case as well.

Read: Know Average Tableau Developer Salary for Freshers & Experienced Professionals!

The alignment and text formatting can be done just by right-clicking on the bars and selecting formatting option-

This will open a pane in the left pane and there we can make the required changes-

This way we can format the chart as required.

It is very important for you to know about tableau bar chart formatting. These days one of the most frequently asked questions of a tableau interview is “What do you know about tableau bar chart formatting?”

While doing the formatting of the bar chart, we should be taking care of the user perspective as well. For example, the selected color should be pleasant to the eye, the size should not be too big nor too small, labeling should be proper and must convey information. Also, tooltip should be aligned in a way to convey additional information.

For example, if you’re showing the numbers in the bar chart, you may show the source of those numbers, comparison, and many other information on the tool tip. Also, tooltip should be formatted properly for the users to get additional information.

As shown in the above image, you can make the changes in the formatting in accordance to the requirement. For example, for making changes to the entire worksheet, you can select the sheet tab, while making changes to the specific rows and columns, select the respective tabs of rows and columns accordingly.

Tableau Online Training & Certification

• Personalized Free Consultation
• Be a Part of Our Free Demo Class

##### Conclusion

This was all about how to create a tableau bar chart where we talked about what is a bar charts, when we should use it, different forms of a bar chart and about tableau bar chart formatting those bar chart. While creating the bar chart, you must be considering why you are creating this?

Can you make any better way to visualize with other charts available? If you have got the answers to these questions then you will definitely end up creating a graph which will make more sense for sure.

Do try these different bar charts for different scenarios and let us know if you face any difficulty while creating the bar chart.

A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.

### Trending Courses

AWS

• AWS & Fundamentals of Linux
• Amazon Simple Storage Service
• Elastic Compute Cloud
• Databases Overview & Amazon Route 53

Upcoming Class

3 days 08 Jul 2022

DevOps

• Intro to DevOps
• GIT and Maven
• Jenkins & Ansible
• Docker and Cloud Computing

Upcoming Class

10 days 15 Jul 2022

Data Science

• Data Science Introduction
• Python & Intro to R Programming
• Machine Learning

Upcoming Class

3 days 08 Jul 2022

• Architecture, HDFS & MapReduce
• Unix Shell & Apache Pig Installation
• HIVE Installation & User-Defined Functions
• SQOOP & Hbase Installation

Upcoming Class

3 days 08 Jul 2022

Salesforce

• Salesforce Configuration Introduction
• Security & Automation Process
• Sales & Service Cloud
• Apex Programming, SOQL & SOSL

Upcoming Class

10 days 15 Jul 2022

QA

• Introduction and Software Testing
• Software Test Life Cycle
• Automation Testing and API Testing
• Selenium framework development using Testing

Upcoming Class

3 days 08 Jul 2022

• BA & Stakeholders Overview
• BPMN, Requirement Elicitation
• BA Tools & Design Documents
• Enterprise Analysis, Agile & Scrum

Upcoming Class

3 days 08 Jul 2022

MS SQL Server

• Introduction & Database Query
• Programming, Indexes & System Functions
• SSIS Package Development Procedures
• SSRS Report Design

Upcoming Class

3 days 08 Jul 2022

Python

• Features of Python
• Python Editors and IDEs
• Data types and Variables
• Python File Operation

Upcoming Class

3 days 08 Jul 2022

Artificial Intelligence

• Components of AI
• Categories of Machine Learning
• Recurrent Neural Networks
• Recurrent Neural Networks

Upcoming Class

11 days 16 Jul 2022

Machine Learning

• Introduction to Machine Learning & Python
• Machine Learning: Supervised Learning
• Machine Learning: Unsupervised Learning

Upcoming Class

24 days 29 Jul 2022

Tableau

• Introduction to Tableau Desktop
• Data Transformation Methods
• Configuring tableau server
• Integration with R & Hadoop

Upcoming Class

4 days 09 Jul 2022

### Browse Categories

Search Posts

Trending Posts

Related Posts

Receive Latest Materials and Offers on Tableau Course