Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tableau 10 Complete Reference

You're reading from   Tableau 10 Complete Reference Transform your business with rich data visualizations and interactive dashboards with Tableau 10

Arrow left icon
Product type Course
Published in Dec 2018
Publisher Packt
ISBN-13 9781789957082
Length 496 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Joshua N. Milligan Joshua N. Milligan
Author Profile Icon Joshua N. Milligan
Joshua N. Milligan
Tristan Guillevin Tristan Guillevin
Author Profile Icon Tristan Guillevin
Tristan Guillevin
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Title Page
About Packt
Contributors
Preface
1. Creating Your First Visualizations and Dashboard 2. Working with Data in Tableau FREE CHAPTER 3. Moving from Foundational to More Advanced Visualizations 4. Using Row-Level, Aggregate, and Level of Detail Calculations 5. Table Calculations 6. Formatting a Visualization to Look Great and Work Well 7. Telling a Data Story with Dashboards 8. Deeper Analysis - Trends, Clustering, Distributions, and Forecasting 9. Making Data Work for You 10. Advanced Visualizations, Techniques, Tips, and Tricks 11. Sharing Your Data Story 12. Catching Up with Tableau 2018 13. Deal with Security 14. How to Keep Growing Your Skills 1. Other Books You May Enjoy Index

Creating line charts


Line charts connect the related marks in visualization to show movement or relationship between connected marks. The position of the marks and the lines that connect them are the primary means of communicating the data. Additionally, you can use size and color to visually communicate additional information.

The most common kind of line chart is a time series chart. Time series show the movement of values over time. They are very easy to create in Tableau and require only a date and a measure.

Continue your analysis of Superstore sales using the Chapter 01 Starter workbook that you saved earlier. The following are the steps to get the output of the Sales over time graph:

  1. Navigate to the Sales over time sheet.
  2. Drag the Sales field from Measures to Rows. This will give you a single, vertical bar representing the sum of all the sales in the data source.
  1. To turn this into a time series, you must introduce a date. Drag the Order Date field from Dimensions in the data pane on the left and drop it on Columns. Tableau has a built-in date hierarchy and the default level of the year has given you a line chart connecting four years. Notice that you can clearly see an increase in sales year after year:
  1. Use the drop-down menu of the YEAR(Order Date) field on Columns (or right-click the field) and switch the date field to use the Quarter. You may observe that Quarter is listed twice in the drop-down menu. We'll explore the various options for date parts, values, and hierarchies in the Visualizing dates and times section of Chapter 3,Moving from Foundational to More Advanced Visualizations. For now, select the second option:

Observe the cyclical pattern that is quite evident when looking at the sales by quarter:

Iterations of line charts for deeper analysis

Right now you are looking at the overall sales over time. Let's do some analysis at a slightly deeper level:

  1. Navigate to the Sales over time (overlapping lines) sheet where you will find a view identical to the one you just created.
  1. Drag the Region field from Dimensions to Color. Now, you have a line per region with each line being a different color and a legend indicating which color is used for which region. As with the bars, adding a dimension to color splits the marks. However, unlike the bars where the segments were stacked, the lines are not stacked. Instead, the lines are drawn at the exact value for the sum of sales for each region and quarter. This allows for easy and accurate comparison. It is interesting to note that the cyclical pattern can be observed for each region, as shown:

With only four regions, it's fairly easy to keep the lines separate. What about dimensions that have more than four or five distinct values?

  1. Navigate to the Sales over time (multiple rows) sheet, where you will find a view identical to the one you just created.
  2. Drag the Category field from Dimensions and drop it directly on top of the Region field currently on the Marks card. This replaces the Region field with Category. You now have 17 overlapping lines. Often you'll want to avoid more than two to four overlapping lines. However, clicking an item in the color legend will highlight the associated line in the view. Highlighting can be a good way to pick out a single item and compare it to all others.
  3. Drag the Category field from Color on the Marks card and drop it on Rows. You now have a line chart for each category. Now you have a way to compare each product over time without overwhelming the overlap function. You can still compare trends and patterns over time. This is the start of a sparklines visualization that will be developed fully in the Advanced visualizations section of Chapter 10,Advanced Visualizations, Techniques, Tips, and Tricks.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image