• Have you ever wanted to create a visualization that’s a mix of a line and a scatter plot as shown here?

A user contacted me a few weeks ago and asked if Spotfire could create a plot like this.  The answer is that yes, Spotfire can create this chart.  This particular visualization is not a combo chart or a line chart.  It’s a scatter plot that uses line connections for one of the variables (oil in this case).  I did run into a bit of difficulty in figuring out which column of data should be used to create the line connection, and it was tricky enough that I thought it deserved a blog post.

Here is the original data table.

Now, I knew I could use the scatter plot line connection in order to connect the scatter plot dots, and the way this feature works by having the user specify a column of data to “Draw a separate line per value in” (as shown below).

This is akin to saying “draw a line for each <x>”.  In this case, I needed a column of data where the values would be blank for the test values so that no line would appear.  Because of this requirement, I also realized that I needed to unpivot.

 

So I did just that.  I unpivoted the data so that I had a column called Produced or Test and a column called Volume.

From that point, I created a calculated column called c.Line using the following IF statement: If([Produced or Test]=”Oil”,[Time]).

With this new arrangement of data, I just setup the line connection as shown below.

And voila!

 

Spotfire can’t yet create those rounded edges, but it’s a good end result.

Written by Julie Schellberg of Big Mountain Analytics, LLC
Residing in Whitefish, MT, an analytics partner with Ruths.ai. Specializing in Spotfire analytics, dabbling in Power BI and R.