Why Dynamic Y-axis Labels in Graphs are the Worst

Let’s talk about one pet peeve of mine in data visualizations: when your y-axis labels (the labels that go from top to bottom) automatically adjust themselves based on the data presented.

Now, in a few cases this is fine, but in most cases, you’re trying to visually compare the height of your chart content (let’s say bars in this case) from view to view, and if the y-axis labels dynamically update, the bar height becomes totally meaningless from view to view. I no longer have the ability to visually compare one bar against another.

A video is worth a thousand words, so here’s an example of trying to figure out if a 2-day trip to Vegas or a 3-day trip to Vegas is cheaper on Kayak.com:

Do not do this:

Thank goodness for the tooltip here, but it does force me to fall back to reading the number in the tooltip to make my comparison, totally eliminating the need for a data visualization here at all.

How to fix:

Calculate the upper bound on your data set across a reasonable number* of views and set the y-axis to be the same thing across these views.

*There’s some nuance here to keep your chart feeling snappy. Regarding “a reasonable number” of views: if >80% of people will click to another view of the chart n times or less, but your chart could have 200 views, or infinite views (e.g., looking at a time-based view and the user is clicking forward into the future), and you’re having to query the data live and covering more edge cases may negatively impact performance of that first chart loading quickly, then optimize your y-axis for the >80% use case (max over n views).

Thank you for coming to my TED Talk.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.