Most people know that line charts are a great way analyze data.
Two reasons why this is true
- Reason 1: People know how line charts work. They are easy to understand and are familiar to most people.
- Reason 2: Line charts are great for showing how things change over time.
You’ve probably created line charts on paper or even in Excel. Along with bar charts, line charts are one of the most common chart types.
Here’s the thing
Creating basic line charts in Tableau is very easy (as you’ll see below). Just dragging and dropping a few times.
But, if you’re just getting started with Tableau you might not know about a few more advanced line chart types.
There are few tips and tricks to create awesome Tableau line charts and this guide goes through everything you need.
Basic Line Chart
- Drag a
Dimension
field to the Columns section - Drag a
Measure
field to the Rows section
In my example, I’m using the MONTH(Order Date)
and SUM(Sales)
from the Superstore Sample Data set that comes with Tableau.
[/et_pb_text]
[et_pb_text admin_label=”Basic Line Chart GIF” _builder_version=”3.27.4″] https://imgur.com/VWoLpeR [/et_pb_text]
[/et_pb_column][/et_pb_row][et_pb_row _builder_version=”3.25″ background_size=”initial” background_position=”top_left” background_repeat=”repeat”][et_pb_column type=”4_4″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”]
[et_pb_text admin_label=”Line Charts with Multiple Measures” _builder_version=”3.27.4″]
Line Charts with Multiple Measures
- Drag a
Dimension
to the Columns card - Drag
Measure Names
to the Filters card and choose your Measures - Drag
Measure Values
to the Rows card - Drag
Measure Names
to the Colors section of the Marks card
For this example, I’ve chosen to show Profit
, Quantity
, and Sales
for each month going back a few years. [/et_pb_text]
[et_pb_text admin_label=”Line Charts with Multiple Measures GIF” _builder_version=”3.27.4″] https://imgur.com/43vJU8H
Trend Lines and Forecasting
#back to top You can show trend lines and forecasts on your Tableau line chart by using the built-in tools. For instance, if you want to extend your data into the future past the data you have, then it’s just a few clicks to add that into Tableau and provide an early look at your data for your audience.
- Drag a
Dimension
to the Columns card - Drag
Measure Names
to the Filters card and choose your Measures - Drag
Measure Values
to the Rows card - Drag
Measure Names
to the Colors section of the Marks card - Click the
Analytics
tab of the Data pane - In the
Model
menu, drag Trend Line to your chart and select a type - Right-click on any
Trend Line
to view it’s details - You can add a
Forecast
to the line chart in the same way and view it’s details.
[/et_pb_text]
[et_pb_text admin_label=”Trend Lines and Forecasting GIF” _builder_version=”3.27.4″]
Line Chart and Bar Chart Combined
Combining a line chart with a bar chart in Tableau is a good way to show two related metrics together. For example, this view is great to show monthly averages along side of weekly data points. Keep in mind, it’s especially useful for an Executive Dashboard that shows a lot of data in a small amount of screen space.
- Drag a
Dimension
to the Columns card - Drag
Measure Names
to the Filters card and choose your Measures - Drag
Measure Values
to the Rows card - Drag a different
Measure
field to the Rows section so they are side by side - Adjust the chart types for each measure in the
Marks
card- The first measure should be a bar chart
- The second measure is the line chart
- Click on the second measure and select
Dual Axis
from the drop-down menu - Right click on the right axis section and
Synchronize
your axis. - Finish formatting as needed
Reminder:
Be sure to label your charts and axis properly to avoid confusing your audience
Line Chart and Dot Plot Combined
This is a great Tableau “hack” to highlight specific data points with a line chart. Of course, you can skip the highlight part of this and just show the dot plot and line chart combined.
- Drag a
Dimension
to the Columns card - Drag
Measure Names
to the Filters card and choose your Measures - Drag
Measure Values
to the Rows card - Drag a different
Measure
field to the Rows section so they are side by side - Adjust the chart types for each measure in the
Marks
card- The first measure should be a dot chart
- The second measure is the line chart
- Click on the second measure and select
Dual Axis
from the drop-down menu - Right click on the right axis section and
Synchronize
your axis. - Finish formatting as needed
To highlight specific data points like in my example below
- Create a calculated field called Position
- Enter the code to show what data points should be highlighted
IF FIRST() = 0 then "First" IF LAST() = 0 then "Last" ELSE "Other" END
- Finish formatting as needed
Line Chart and Area Chart Combined
This is a great way to add a small border to an area chart in Tableau to make it stand out in your next project.
- Drag a
Dimension
to the Columns card - Drag
Measure Names
to the Filters card and choose your Measures - Drag
Measure Values
to the Rows card - Drag a different
Measure
field to the Rows section so they are side by side - Adjust the chart types for each measure in the
Marks
card- The first measure should be a area chart
- The second measure is the line chart
- Click on the second measure and select
Dual Axis
from the drop-down menu - Right click on the right axis section and
Synchronize
your axis. - Finish formatting as needed
Tableau Dotted Line Chart
Dotted lines are surprisingly difficult to get working in Tableau. There’s no “easy button” to get a dotted line in Tableau but you can use these step by step instructions to create one from scratch.
- Drag a
Dimension
to the Pages card - Drag the same
Dimension
to the Columns card. - Drag a
Measure
to the Rows card - Set the
Mark
type to Circle - In the
Pages
controller card, configure the view:- Show history for all marks
- Length = All
- Show = Trails or Both
- Format = Dotted line
- Finish formatting as needed
Formatting Tips & Tricks
Basic line chart formatting in Tableau is pretty easy. You can set the Colors, Size, and Line Styles using the Marks card.
But here are a few more useful formatting tips and tricks that I’ve used in past Tableau projects.
- Create any type of line chart in Tableau using one of the methods above
- Drag measure values to the Size section of the
Marks
card - Set the Labels section of the
Marks
card to show labels on the side of each line - Adjust the Axis as needed so the labels fit on the screen
- Right-click any point to add an Annotation to your line chart to draw attention.
Remember, the annotations can be formatted as well
- Adjust the background and border colors
- Adjust the shape from a hard corner to round corner
- Adjust the line style from solid to dotted
Conclusion
In this guide, you learned everything you need to create line charts in Tableau.
- How to create simple line charts in Tableau
- The quickest way to create line charts using multiple measures
- All about line chart forecasting and trends
- How to make your Tableau line charts look awesome
- Combining bar charts with line charts
- Adding dots to your line charts with highlighting
- Creating a combo chart for area and line charts
- The easiest way to create a dotted line chart in Tableau
Okay, now it’s your turn
- Download the bonus materials for this guide (PDF checklist and Tableau workbook)
- Pick one of the techniques above to create or improve one of your Tableau projects and shoot me a tweet @NewPrediction