All examples By author By category About

ndarville

Majority chart

(This chart is a part of the d3-charts collection available here.)


This is a majority chart, my own tweak of a plain symmetry bar chart. It displays a vertical bar chart with each bar anchored around a common origin of 50%. The code was based on Mike Bostock's "Bar Chart with Negative Values" chart, inspired by a post on Junk Charts, and was originaly used for an article I wrote, "Women in Tech by the Numbers", in which I explained the chart like so:

Just in case the chart needs explaining, each bar displays how the men outnumber the women---and vice versa. If a group of software engineers at a company is 90% male, the bars will display the differential of 40% from an even 50%.

Because the point of the chart is to display majorities, there is no point in showing the first 50% of a majority; it is completely redundant, when you can just show the percentage one side is ahead of the other.

Unlike the examples in the two links of inspiration, the x-axis of this implementation has a symmetric x-axis to ensure readers aren't perceptually manipulated by one side taking up a larger, more imposing, share of the space than the other.

The main thing to have in mind when using this particular chart is that the order of your data rows matters; a part of the story this chart tells uses the vertical dimension, so embrace it. Usually, you'll see people use the chart for demographics with people divided by age or income, but there are plenty of other uses you'll realize soon enough.

The placeholder data shows how Americans voted by income brackets in the 2012 election.

Future Features