Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
What is Line Chart?
3.
Importance of Line Charts
4.
Advantages of Line Charts
5.
Disadvantages of Line Charts
6.
Creating Line charts in Tableau
7.
Frequently Asked Questions
7.1.
What is Tableau?
7.2.
What is a line chart?
7.3.
Can we add forecast lines to the line charts in Tableau?
7.4.
What is the importance of line charts?
7.5.
What data types are supported in line charts?
8.
Conclusion
Last Updated: Mar 27, 2024

Making Line Charts in Tableau

Author Aditya Gupta
0 upvote
Crack Google SDE interview : Essential projects
Speaker
Saurav Prateek
SDE-2 @
20 Jun, 2024 @ 01:30 PM

Introduction

Hey Ninjas! Line charts are a way of visually representing data. It shows how some data changes over a specific period. It is the most basic depiction of data that we use in Tableau. When we want to analyse product prices over a period of time we mainly use line charts in Tableau. 

Making Line Charts in Tableau

In this blog, we will discuss the use of line charts and their advantages and disadvantages. We will see how to make line charts in Tableau, along with an example.

What is Line Chart?

The line chart is a representation of changes in data over a period of time. It is the most basic chart type which we use to compare data prices and analyse the changes in data so that we can forecast how the data might look in the future.

Line Chart
Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Importance of Line Charts

Before learning how to make line charts in Tableau, it is important to understand the importance of line charts.

  • It is an efficient way of representing changes in data over short and long periods. 
     
  • It helps us identify patterns and predict future changes in data. For example, while working with sales data, we can use line charts to determine the sales pattern in different months over the past few years and predict the sales for upcoming months.
     
  • With the help of line charts, different data groups can be compared at once. We can compare the stock prices of other companies in the last few months in line charts.

Advantages of Line Charts

So, Ninjas, you might have understood the importance of line charts. Now let us look at some of the advantages of line charts.

  • It is a simple and clean way to represent changes in data.
     
  • Line charts can also show different small changes in data that other charts might not be able to depict.
     
  • Line charts can also be used to represent various data types and their aggregation also.
     
  • Line charts help us keep track of data by simply seeing the data to make better decisions.
     
  • We can also represent multiple data on an axis at the same time and compare them simultaneously.

Disadvantages of Line Charts

There are some disadvantages of line charts that we need to consider before using them.

  • Different line charts will be built when we show various kinds of data on the same axes, making it difficult to understand.
     
  • It can only represent integer changes in any data and does not work well with fractional changes.
     
  • If the data values are missing for a time period, the line chart might not be the best fit to represent the data.
     
  • It is an efficient way of representing data over a short period. Still, it isn't easy to understand and analyse line charts when representing data over a long time.

Creating Line charts in Tableau

Firstly, let us look at example data, on which we will try to make line charts.

We have taken a sample dataset from Tableau Public showing the sales and profit of a superstore for different years.

Sample data

Now step by step, we will try to use the line chart in Tableau.

Step 1: We have data present in Excel form. Let us upload this Excel file on Tableau.

Connecting data to Tableau

After connecting the Excel file to Tableau, It should look like the image below.

Tableau sheet

Step 2: Now, we will go to the worksheet. This is where we will create line charts for the data.

worksheet

Step 3: For this example, we will add Sales data on Y-axis and Year on the X-Axis of the line chart. To do this, we will just drag and drop the sales and year icons into columns and rows.

creating line chart

Now, we have created a line chart (Sales vs Years), and it should look like this.

line chart 1

Step 4:  As we have created a line chart, now we will try to create a multi-line chart by dragging profit data to the rows. A new line chart will be created by dragging and dropping, as shown below.

line chart 2

The line chart should look like this.

line chart 3

Step 5: Now, we will merge both line charts by dragging the SUM(Profit) icon onto the Y-axis of the first line chart.

line chart 4

The Multi-line chart should look like this.

Multi line chart 1

Step 6: We can also change the color, size, add labels and change the types of lines of the line charts to make the charts more appealing by using the options under Marks icons.

Customization in line chart

So, Ninjas, This is the complete step-by-step procedure to make a line chart in Tableau.

Frequently Asked Questions

What is Tableau?

Tableau is a data visualisation tool used to create stunning visuals, and it also helps us do various operations on the data.

What is a line chart?

Line charts are a way of visually representing data. It shows how some data changes over a specific period.

Can we add forecast lines to the line charts in Tableau?

Yes, Tableau has a feature named add Trend line, which helps us in adding forecast lines.

What is the importance of line charts?

Line charts are useful for analysing changes in data over a period of time.

What data types are supported in line charts?

Integers and boolean data types are supported in line charts.

Conclusion

This article discusses the topic of making line charts in Tableau. In this blog, we have discussed the importance of line charts, their advantages and disadvantages and how to create line charts in Tableau. We hope this blog has helped you enhance your knowledge of line charts in Tableau. If you want to learn more, then check out our articles.

And many more on our platform Coding Ninjas Studio.

Refer to our Guided Path to upskill yourself in DSACompetitive ProgrammingJavaScriptSystem Design, and many more! If you want to test your coding ability, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio!

But suppose you have just started your learning process and are looking for questions from tech giants like Amazon, Microsoft, Uber, etc. In that case, you must look at the problemsinterview experiences, and interview bundles for placement preparations.

However, you may consider our paid courses to give your career an edge over others!

Happy Learning!

Previous article
Making Word Cloud in Tableau
Next article
Data analytics in Python
Live masterclass