I recently saw this graph at http://www.npr.org/blogs/money/2014/10/21/357629765/when-women-stopped-coding.
The topic caught my attention but the labels made me cringe.
This graph is challenging to read in color (which turquoise category goes with which line?) and would be impossible to read when printed or photocopied in black and white.
These data labels and separate legend score a big fat zero on the Data Are Labeled Directly section of the Data Visualization Checklist.
The solution is simple. First, remove the legend:
Then, insert those labels beside their corresponding lines. The goal is to get the labels as close as possible to the actual line so that your viewers aren’t zig-zagging their eyes back and forth between the lines and the legend.
To insert labels next to the lines, you can:
- Format the data labels so that the label contains the category name. In Excel, right-click on the data point on the far right side of the line and select Add Data Label. Then, right-click on that same data point again and select Format Data Label. In the Label Contains section, place a checkmark in either the Series Name or Category Name box.
- Or, insert text boxes next to the lines. There’s no magic behind text boxes; insert the as you normally would just like when you’re using Word or PowerPoint. Text boxes take a few seconds longer but give you greater flexibility than traditional data labels in terms of placement.
Finally, for bonus points, color-code the labels so that they match their lines. Turquoise for medical school, law school, and the physical sciences, and red for computer sciences.
Direct labeling! A small edit for you and a huge advantage for your viewers.
Gregor
Aug 25, 2015 -
Ha, and now make a 300px version of this for mobile. Not always as simple as it looks..
Steven Vrooman
Aug 25, 2015 -
This is good stuff. I hate legends. Why add needless complexity as you work for engagement?
Jeffrey Shaffer
Aug 26, 2015 -
Great solution. I think the other thing that would help is if they used a categorical color scheme for the different categories rather than mixing in a sequential color scheme. Four distinct colors would be ideal, encoding with color hue rather than color value.
hrbrmstr
Aug 27, 2015 -
I suspect the reason for the color choices was to significantly highlight the comp sci downturn which directly aligns with their story/segment. I think it makes more sense this way. If it was a more general chart, perhaps not.
Brian Stacey
Aug 27, 2015 -
Another visual problem with this graph is the missing data – at the critical point!
What happened in Law School and Physical Sciences for the past few years?
Should Law School actually end up above Medical School – based on presumed trends?
Should your labels be re-ordered to show the latest position (once again, based on presumed trends)?
Ann K. Emery
Aug 27, 2015 -
Please check out Bob Rudis’ post for a tutorial on directly labeling line graphs in R: http://rud.is/b/2015/08/27/coloring-and-drawing-outside-the-lines-in-ggplot/
Matt
Aug 30, 2015 -
https://gist.github.com/ramnathv/6ce063236154691e8f30
Tyler Lubben
Jun 17, 2016 -
Hey Ann K. Emery,
Nice write up!!
I must say that the idea of removing the legend is amazing. Thanks you so much for providing the steps to insert labels in the chart. I will surely try them
Looking forward for more posts 🙂
Ann K. Emery | The Simplest Excel Hack You’ll See Today
Aug 4, 2017 -
[…] the mostly edited version: reduced clutter; custom color; labels directly beside the data; reduced gap […]