Slope charts in Tableau emphasize the start and end date changes on the data, removing all the noises and the crazy ride in between. This leaves you only the most important data to focus on.
Why should you use a slope chart in Tableau?
Imagine we have the following chart:
How useful is this? How much insight can we pull from this noise? Very little. With the data highlighter, that would help, but still we would have to go one at a time.
What if we just wanted to compare a start point vs. an end result and eliminate the noise in between? For this, we can use a Slope Chart. Slope Charts look like this. They show the starting point and the ending point, and they eliminate all the points in between. They’re great for showing a before/after scenario, and can also reveal rankings, changes, and the magnitude of said change.
Building a Slope Chart with a Continuous Axis
- Start by bringing Profit to Rows and Order Date to Columns.
- Click the drop down arrow on Order Date to Month (May 2015). It’s in the second set of dates. We’re making this date continuous, not discrete. The pill should now be green.
- Bring Order Date to the Filter shelf, and set it Range of Dates.
- Click the down arrow on this filter and choose Show Filter.
- Now, create a calculation called “First or Last.” Do this by right clicking in Measures > Create Calculated Field, or by choosing the drop down arrow from the top of the data pane near Dimensions.
- Write the following formula: FIRST() = 0 or LAST() = 0. Choose Ok.
- Drop this on Size. You’ll see that the ends of the line get larger, while there isn’t much change in the middle.
- A size legend will appear. Right click on false and then choose Hide.
- Drop Product Sub-Category onto the Labels shelf. Your view should now look like this:
- Click the Color shelf icon and under Effects > Markers, set it to the second icon with the dots. This will create a circle for each end of the line.
- Hold down the Ctrl key and drag a second instance of Profit to the right on the Rows shelf.
- Click the down arrow on that second Profit pill and choose Dual Axis.
- Right click on that second axis and then choose Synchronize Axis.
- Set the date field by typing in 10/1/2009 and 10/31/2012 in the Order Date filter at the top right. Your view should now look like this:
- Click the down arrow on the Product Sub-Category pill and turn on the Data Highlighter. You can now highlight a particular element and see changes.
- On the first, Sum(Profit) Shelf on the left, click the Label icon, and turn off “Show Mark Labels.”
- On the second one, click Label and ensure Show Mark Labels is checked. Down below that, set Marks to Label to Line Ends. Beneath that, uncheck the box that says “Allow labels to overlap other marks.” We can immediately see that Office Machines have become much more profitable for us, while Copiers and Faxes have dropped dramatically and are now losing money.
With the data highlighter in use, we can zero in on any product line, like this:
Quick Tips:
If I wanted to see an end result vs. a starting point and eliminate distracting data, the best charts to use are Slope Charts in Tableau.
Why?
Slope charts eliminate noise from a time series or trend and show you just where you started and where you finished. It’s helpful if you just want to see if you made progress, or where you ended up.
Now that you know when to use a Slope Chart in Tableau and how to use it when needed, be sure to check out our Advanced Tableau classes, available for individuals and corporate teams.