« January 2022 | Main | March 2022 »

Improving simple bar charts

Here's another bar chart I came across recently. The chart - apparently published by Kaggle - appeared to present challenges data scientists face in industry:

Kaggle

This chart is pretty standard, and inoffensive. But we can still make it better.

Version 1

Redo_kaggle_nodecimals

I removed the decimals from the data labels.

Version 2

Redo_kaggle_noaxislabels

Since every bar is labelled, is anyone looking at the axis labels?

Version 3

Redo_kaggle_nodatalabels

You love axis labels. Then, let's drop the data labels.

Version 4

Redo_kaggle_categories

Ahh, so data scientists struggle with data problems, and people issues. They don't need better tools.


Easy breezy bar charts, perhaps

I came across the following bar chart (link), which presents the results of a survey of CMOs (Chief Marketing Officers) on their attitudes toward data analytics.

Big-Data-and-the-CMO_chart5-Hurdle-800_30Apr2013Responses are tabulated to the question about the most significant hurdle(s) against the increasing use of data and analytics for marketing.

Eleven answers were presented, in addition to the catchall "Other" response. I'm unable to divine the rule used by the designer to sequence the responses.

It's not in order of significance, the most obvious choice. It's not alphabetical, either.

***

I think this indiscretion is partially redeemed by the use of color shades. The darkest blue shade points our eyes to the most significant hurdle - lack of investment in technology (44% of respondents). The second most significant hurdle is "availability of credible tools for measuring effectiveness" (31%), and that too is in dark blue.

Now what? The third most popular answer has 30% of the respondents, but it's shown by the second palest blue! I then realize the colors don't actually convey any information. Five shades of blue were selected, and they are laid out from top to bottom, from palest to darkest, in a sequential, recursive manner.

***

This chart is wild. Notice how the heights of the bars are variable. It seems that some bars have been widened to accommodate wrapped lines of text. These small edits introduce visual distortion so that the areas of these bars no longer are proportional to the data.

I like a pair of design decisions. Not showing decimal places and appending the % sign on each bar label is good. They also extend the horizontal axis to 100%. This shows what proportion of the respondents selected any particular answer - we note that a respondent is allowed to select more than one response.

The following is a more standard way of making a bar chart. (The color shading is not necessary.)

Redo_CMOsurveyanalytics

This example proves that the V corner of the Trifecta Checkup is still relevant. After one develops a good question, collects useful data and selects a standard chart form, figuring out how to visually display the information is not as easy breezy as one might think.


Ringing in the data

There is a lot of great stuff at Visual Capitalist.

This circular design isn't one of their best.

Visualcapitalist_GDPDebt2021_1800px_Finalized

***

A self-sufficiency test helps diagnose the problem. Notice that every data point is printed on the diagram. If the data labels were removed, there isn't much one can learn from the chart other than the ranking of countries from most indebted to least. It would be impossible to know the difference in debt levels between any pair of countries.

In other words, the data labels rather than visual elements are doing most of the work. In a good dataviz, we like the visual elements to carry the weight.

***

The concentric rings embed a visual hierarchy: Japan is singled out, then the next tier of countries include Sudan, Greece, Eritrea, Cape Verde, Italy, Suriname, and Barbados; and so on.

What is the clustering algorithm? What determines which countries fall into the same group?

It's implicitly determined by how many countries can fit inside the next ring. The designer carefully computed the number of rings, the widths of the rings, the density of the circles, etc. in such a way that there is no unsightly white space on the outer ring. Score a 10/10 for effort!

So the clustering of countries is not data-driven but constrained by the chart form. This limitation is similar to that found on maps used to illustrate spatial data.

 

 


Type D charts

A twitter follower sent the following chart:

China_military_spending

It's odd to place the focus on China when the U.S. line is much higher, and the growth in spending in the last few years in the U.S. is much higher than the growth rate in China.

_trifectacheckup_imageIn the Trifecta Checkup, this chart is Type D (link): the data are at odds with the message of the chart. The intended message likely is China is building up its military in an alarming way. This dataset does not support such a conclusion.

The visual design of the chart can't be faulted though. It's clean, and restrained. It even places line labels at the end of each line. Also, the topic of the chart - the arms race - is unambiguous.

One fix is to change the message to bring it in line with the data. If the question being addressed is which country spends the most on the military, or which country has been raising spending at the fastest rate, then the above chart is appropriate.

If the question is about spending in China, then a different measure such as average annual spending increase may work.

Neither solution requires changing the visual form. That's why data visualization excellence is more than just selecting the right chart form.