This post describes how to build a very basic grouped 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
Data is available here. Have a look to it. Note the wide (untidy) format: each group is provided in a specific line, each subgroup in a specific column.
The trick here is to build two X scales. The first is called x and is for groups. It is used to build the axis. The second is called xSubgroup and allows to adjust the position for each subgroup in the group.