This post describes how to build a very basic stacked barplot with d3.js. You can see many other examples in the barplot section of the gallery. Learn more about the theory of boxplots in data-to-viz.com. This example works with d3.js v4
and v6
d3.stack()
function is used to stack the data: it computes the new position of each subgroup on the Y axisd3.stack()
can be used to create a set of rect
as for a normal barplot.