Connected Cycle Plots in Tableau with Set Actions

Cycle plots are commonly used to show trend and seasonality in time-series data for day-of-week patterns, hour-of-day, month-of-year, quarter-of-year, and so on.

To learn more about them, I recommend having a glance at this paper by Naomi Robbins.

There’s also a whitepaper from Andy Cotgreave about ways to visualize time on Tableau.com. It’s quite a neat read!

First, let’s have a look at some of the use cases.

Examples of cycle plots in real life

“Wildlife strikes on planes in the US” from Andy Cotgreave’s whitepaper:

This is a textbook cycle plot showing the yearly evolution for each month. It is common to add average lines for each month to compare them more easily.

There’s also a shading beneath each line, making it easier to notice the magnitude (the distance from the baseline).

A look at ozone levels in the US by Andy Kriebel:

Similarly to the first one, it displays month-of-the-year values. Instead of average lines, Andy chose to add trend lines to emphasize the different monthly patterns.

TSA Claims by yours truly:

First I have a line chart with the yearly claims evolution. At the bottom, there’s a cycle plot with the quarterly values across years.

I added lines and shading to show that the averages for Q3 and Q4 are lower than Q1 and Q2.

There’s also an action to highlight the different quarters when you hover a specific year.

So easy to create in Tableau

We start with a standard time-series line chart for which:

  • we add a lower granularity date part
  • we move that date part before the initial one in the column shelf
  • we change the scope of reference lines to work for each pane

Three steps later we have our chart!

An idea to improve on Cycle Plots

I am currently on a quest to figure out the best ways to analyze cohorts using interactive Tableau visualizations.

I took some inspiration from Intercom’s blog post about improving retention, and I created the following cycle plot “style” chart:

Every data point from a line represents the retention rate of a cohort in a specific week after the acquisition.

While it’s easy to understand the trend for every week and the overall tendency, it’s difficult to keep track of individual cohorts across weeks.

A highlight action could make them easier to follow:

Another thing we can do is to add reference lines that update when we hover:

This way we can compare the positions of the reference lines to see the trends for each cohort.

I am not completely satisfied with any of these methods. Since we have Set Actions in our bag of tricks, the idea of connecting the different categories on hover became achievable:

With this chart, we’re packing 3 types of insights: trends, seasonality and evolution of individual categories (cohorts in our case).

It probably won’t work well with lots of data points since it can clutter the view quite quickly. However, I believe it’s a good addition in this case.

The Tableau challenge

While cycle plots are easy to create in Tableau, connecting dots from different series isn’t.

If we build the cycle plot in the usual way, we’ll end up with panes for each week number. As you might know, we can’t connect lines across panes.

My solution was to get rid of the panes. I did this by combining the “Week number” and “Cohort” fields into a single one. Here’s how I set up the worksheet:

At this point, all I have to do is to create a set from the “Cohort” field, add the values as a dual axis and use the path shelf to connect the dots:

“Set values” holds the amounts for a particular category/cohort/point in time.

The set action used for the interactivity is quite simple:

For the nitty-gritty details on how I set it up and what calculations I used, you can download the workbook from Tableau Public and reverse engineer.

Closing thought

My feeling is that interactivity is one of the most significant leaps in data visualization in modern times.

Allowing users to play with graphs in different ways can significantly reduce their time-to-understand.

If you have any questions or if you need help, let me know!

Related Post

This website uses cookies.