The Extensible, Invisible Reference Line

The Extensible, Invisible Reference Line

A request that gets sent my way quite frequently is to create a rolling ‘N’ month view of a particular metric based on a user-defined end date range.

Defining the Date Range is easy enough with a simple filter…

A Simple Date Range filter that is applied to ensure a rolling 12 month period is in the view

A Simple Date Range filter that is applied to ensure a rolling 12 month period is in the view

Which allows us to then create a very simple but effective chart…

bars.png

In the real world, however, it is likely that certain segments or products may be missing data or may perhaps have just been launched, and therefore may not have the same amount of historical data as other segments.

This can introduce a potential issue where the number of observations in the chart does not align with the specified time period of the chart.

For example, let’s assume we are required to create a 12-month view of Discount %, based on a user-selected end month. However, discounts were only introduced in the Home Office segment as of June of 2019. Prior to that, there is no data for that segment.

Thus, when the user switches to the Home Office segment, instead of 12 months in the view, he is left with the 7 months that span the time period from inception of the discount to the user-selected End Month.

bar_gif.gif

The issue here is not inaccuracy (after all, there are only 7 months of historical data) The issue is inconsistency. When viewing a 12 month, time series chart, many people expect to see 12 months across the X-axis.

To resolve this, we can of course fix the axis, or impute 0 records for the missing months in our data source, but a simpler way to do it is to use a continuous-time period pill on the columns shelf, in conjunction with an invisible reference line to ‘fix’ the axis…

Step 1: Create a Min Date Month Field…

This will derive the ‘start’ month of the 12 month period based on the user selection

This will derive the ‘start’ month of the 12 month period based on the user selection

Step 2: Drag Min Date Field to Marks - Detail

Step 3: Convert Time Dimension on Columns shelf to Continuous

steps 2 plus 3.gif

Step 4: Create the Invisible Reference Line

step 4.gif

This is a nice little trick that can be used to ensure a consistent number of time periods appear in the chart while also maintaining flexibility and user interactivity.

In addition to fixing a time-series, Mark Edwards has also written a post about how ‘Secret’ reference lines can be used to add ‘padding’ to a chart to ensure labeling is visible.


Designing for Visual Effect

One of the major stories of my Iron Viz Final Dashboard was the disparity of people living in cities with healthy breathing air compared to people living in cities with unhealthy breathing air.

The number of cities that fell into those categories (Healthy, moderately Healthy & Unhealthy) was relatively similar, but there was a HUGE difference when it came to the number of people, and I really wanted to drive that point home in the viz.

Inspired by Data Journalists

There have been some really cool visualizations over the last few months that used a chart in a creative way to tell a story about a significant deviation from past/other results.

Consider the March 27th front page of the Wall Stree Journal:

https://twitter.com/wsj/status/1243466572573945857

https://twitter.com/wsj/status/1243466572573945857

The last observation in the jobless claims bar chart is so large it transcends the expected bounds of the chart and nearly extends the height of the paper.

The visual really helps to drive home the story of the magnitude of the change in jobless claims.

Here’s another more recent one that accomplishes a similar effect…

It uses a bar chart to represent political donations by LA team owners and shows just how significantly higher the donation amounts are from the Clippers and Kings/Galaxy than the other area sports teams.

sports.jpg

I wanted to create a similar effect in my own design and use it to tell the story of breathing air inequality.

To do that, I created a calculated field that would be dependent on a user-selected parameter and then I used it as an invisible reference line in the bar chart.

The result of using the ‘Z_Ref_Line’  field as a reference line is that

The result of using the ‘Z_Ref_Line’ field as a reference line is that

The result of using the ‘Z_Ref_Line’ field as an invisible reference line is that when the user-selected City, the additional ‘padding’ in the height of the Y-axis would serve to minimize the perceived variance between the 3 Categories of Healthy, Moderately Healthy, and Unhealthy. However, when a user-selected Population, the lack of additional ‘padding’ in the height of the Y-axis would serve to maximize the perceived variance.

The visual effect was further enhanced by placing the bar chart worksheet partially off of the dashboard canvas, such that when Population was selected, the bar appeared to ‘jump off' of the dashboard …

Y location.jpg

The end result is a rather nice effect that serves to convey the significant discrepancy between people living with healthy and unhealthy breathing air…

Invisible Reference Lines.gif
Click the image to access the dashboard

Click the image to access the dashboard

UK Brexports

UK Brexports

Peleliu

Peleliu