Chapter 9. Line Graphs, Independent Axes, and Date Hierarchies

In the previous chapter, I shared five different ways to make a bar chart in Tableau. This chapter walks you through how to build another key data visualization: the line graph. For all the fancy visualizations I enjoy building with Tableau, at the end of the day, bar charts and line graphs are two of the most effective options available. While we’re at it, we’ll touch on some related topics, including date hierarchies and independent axes, so you can master this foundational graph.

How to Make a Line Graph in Tableau

A line graph is similar to a bar chart in Tableau in that you are looking at one or more measures with the option to “slice and dice” it by one or more dimensions. The important distinction between the bar chart and line graph is that the line graph should include an element of time. Let’s build out a line graph using the Sample – Superstore dataset using Order Date as our element of time.

First, use any of the five methods discussed in Chapter 35 to create a bar chart that adds SUM(Sales) to the Rows Shelf. I’m going to simply double-click the Sales measure to start the view.

At this point, you could also double-click your element of time (Order Date) to start a line graph, but there is a better way. As with measures, dates also have an aggregation and can be used as continuous or discrete fields. The choices you make for these two classifications has an impact on how the visualization will look. Fortunately, ...

Get Practical Tableau now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.