Archives

Dots & Lollipops

Easily create dot plots and lollipop plots in QlikView!

 
I recently came across an excellent poster, published by the Financial Times, that shows the various types of charts that can be used to visualize different types of data. Some of these are the standard charts that we all see dozens of times a day (bars, lines, and whatnot). Other charts are more rare and specialized. So of course I wanted to try to build them in native QlikView.
 
I may or may not revisit other types of charts in later posts, but the two I'd like to start with are (1) lollipop plots, and (2) dot plots that show minimum and maximum values in a range (AKA dumbbell plots). Let me preface this by saying that, for the most part, I completely agree with Stephen Few's assessment that lollipop graphs are often silly. Few correctly points out, for example, that a lollipop is a poor replacement for a bar graph, because you lose both accuracy and precision. The one argument I have in favor of lollipop plots, interestingly enough, is based on a best practice that I learned from Few himself (through his books): to minimize the amount of non-data pixels that you display to users. I would argue that while a lollipop plot is indeed a poor replacement for a bar, it can be a good replacement for a symbol plot. For example, here is a standard symbol plot in QlikView:

 
I have enabled grid lines in the above plot to help users more easily follow a dot to its corresponding X value. One issue with this graph though, is that gridlines continue horizontally beyond the point that they provide any meaningful information. When X = 2, for instance, why do we need the grid line to continue all the way to 35? Those extra pixels provide the user with no additional information, so should, ideally be removed. Here is what the same chart would look like as a lollipop plot:

 
You can download the code below, but creating this plot in QlikView is surprisingly easy. Simply make a combo chart and have one of the expressions be formatted as a special type of box plot that shows only whiskers but no actual box.
 
A very simple extension of the same principle will yield us the second type of chart I mentioned above: a dot plot that shows minimum and maximum values in a range.

 
This chart has more obvious uses than a lollipop, and it cannot be as easily argued that this is just a poor replacement for a bar chart.
 
Feel free to use these techniques in any way you see fit; my philosophy is that you can never have too many tools in your toolbox, even if some are very rarely used. Until next time, happy Qliking!
 
This entry was posted in Tips & Tricks, Visualization and tagged , , , . Bookmark the permalink.

Leave a Reply

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

Notify via email when new comments are added