Menu

Slopegraph

In this tutorial, we’ll demonstrate how to draw a Slopegraph in Glimpse to visualize the change in values between two years across various countries.

First, add in the data from the table below:

Country Year Value
Sweden 1970 48.1
Sweden 1979 57.4
Netherlands 1970 44.0
Netherlands 1979 55.8
Britain 1970 40.7
Britain 1979 39
France 1970 39
France 1979 45.4
Germany 1970 37.5
Germany 1979 40.9
Belgium 1970 35.2
Belgium 1979 43.2
Finland 1970 32.5
Finland 1979 37.2


Then, under Visual > Mark in the Inspector panel, set the Mark Type to Line.

image1


Drag the field Year into the X encoding and in the Inspector panel, change the Measure to Nominal.

image2


Next, drag the field Value into the Y encoding.

image3


In the Inspector panel, go Visual > Encoding > Scale > Domain and untick Include Zero.

image4


Then, drag the field Country into the Color encoding.

image5


To add points to the ends of the slopes, in the Inspector panel go Visual > Mark and activate Point Overlay.

image6


This concludes this tutorial on drawing a Slopegraph. If you want to further customize your chart, please read the documentation.