Tableau first released step and jump lines back in 2018.1, when transparent filters and worksheets were still on the wishlist. Since then, Tableau has treated us with loads of great features and we kind of forgot why this was so well received by the community back then. Let’s jump back in time and remind ourselves why this release was a step in the direction of making our data lie a bit less.
“Wait, did you just call me a liar?”
Well, maybe. If you are using line charts, there is a chance that you might be lying about the data at hand.
Line chart you say, what's that?
A line chart connects two consecutive data points with a straight line, assuming a continuous rate of evolution between them.
Pretty straight forward. Here is the simplest example of a line chart: I have measured the outside temperature at 3:00 PM and 4:00 PM. By drawing a straight line between the two data points, I am highlighting a trend between the numbers; it's getting warmer. And while I didn't record the temperature at 3:30 PM, my line chart suggests that it might have been 19°C. We don't know that for a fact, but it's a decent guess.
However, assuming a continuous rate of evolution isn’t always correct.
Let's say that this time, I am recording every single transaction in and out of my warehouse, and plotting the resulting inventory level against time. Using a line chart between data points, it looks like I had at least 1000 units at the beginning of Week 49. But plotting the same data as a step line chart, this is certainly not true: there was no transaction recorded between Week 46 and Week 50; I only had 400 units in Week 49.
While the classic line chart gives the correct information for each data point, it is displaying false information about what's happening between data points. We know exactly what my inventory position was in Week 49; it didn't change since the last transaction. Assuming a constant rate of evolution until the next data points is telling a completely different story than the reality. If my goal was to report inventory levels, my line chart is "lying" for all bar a few data points.
However, a step line chart would do a much better job telling the truth: every data point is correctly plotted AND the interpretation between them stands correct.
What's a step line chart, you ask?
A step line chart connects two consecutive data points with an horizontal and a vertical line, assuming no evolution until the next data point, where all the change is suddenly plotted vertically.
So why is it that your line chart is great for plotting temperature sampled at intervals but does a bad job conveying cash position with every transaction recorded?
Well, it depends on your data. While it's fine to extrapolate results in between data points for continuous measures, like Temperature, some data doesn't require extrapolation as all changes are known. Your boss' target is a good example: it remains known and the same until it suddenly changes. Inventory levels, granted that every transaction is recorded, also qualify. However, if I was to only take one inventory snapshot every day at 6:00 AM instead of recording every transaction, extrapolating a constant evolution between days might be as good/bad as assuming one single transaction at 6:00 AM.
The other key information when picking your chart, is the type of analysis that you are doing. Each chart type specializes in highlighting a different aspect of the data; pick yours accordingly.
- Line charts are great to highlight then trend over time
- Step line charts are great to highlight the magnitude of the changes
- Jump line charts are great to highlight the length of time between changes
Jump lines, what are those again?
A jump line chart is a step line chart without the vertical line.
Easy, right? Let's look at a practical example where that would be useful: while I know when my inventory will be replenished, the demand my warehouse is facing is much harder to predict. Plotting the running sum of my demand as a jump line highlights the length of time between orders really well.
Now that you know which chart to pick, let's build them in Tableau!
All you need is a date field and a continuous measure. Bring those onto your sheet and you’ll end up with a classic line chart. By clicking on the Path’s mark, you can select the Line Type and choose “Step” or “Jump”.
Hopefully this blog post will turn at least one "lying" line chart into a better one, spreading a bit more truth around.
Jérémy Calloud | Senior Analytics Consultant @ Biztory