Spotfire Features — Line Connections in Scatter Plots

  • 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.

Guest Spotfire blogger residing in Whitefish, MT.  Working for SM Energy’s Advanced Analytics and Emerging Technology team!

7 thoughts on “Spotfire Features — Line Connections in Scatter Plots

  1. Hey Julie. Have you ever tried doing this with data being plotted from related data tables?

    An example might be where monthly volumes and daily tests are in separate tables and we don’t want to combine them with transformations.

    1. I haven’t tried this. If that were going to work, you would also need column matches. Relations facilitate integrated filtering and marking. Column matches are what allow you to put data from different tables on the same visualization.

  2. Hi,
    I really like this solution. And it fits my needs in the report I’m working on, with the only difference, that I have more than two values in the Type column. Say I have oil, gas and coal.
    Once I add this third value, the line starts goofing up, connecting markers from two values, not one.
    If my formula for the line is: if([type] ==’oil’, [time]), it will connect gas and coal. Then I tries to do the opposite: if([type!=’oil’, [time]). This time something really weird happens: oil gets a line. But then for the each time value gas and coal will get a connecting line in between.
    How to make this example work with more than two values?

    1. Are you trying to create a visualization with one line and then two additional sets of data without the line?

      1. I actually having the same exact problem. I have about 5-10 columns that I’m trying to trellis by due to their different scale sizes. However, it’d be great to be able to leave certain parameters as scatter and others as line-connected!

  3. Hi Katya,

    Did you solve this issue? I have the same problem (ten different ‘types’ in my column). I want to connect some types, and others don`t.


Leave a Comment

Your email address will not be published. Required fields are marked *