This post describes how to turn the barplot horizontal with d3.js. This can be handy when you have long labels. Note that you could consider building lollipop plot as well. This example works with d3.js v4
and v6
div
that will be modified by d3 later on.svg
area. It specify the chart size and its margin. Read more.