Categories
Mastering Development

NVD3 – Stacked Bar chart, space after every second bar

I would like to insert 100px of space after every second bar in my stacked bar chart
http://jsfiddle.net/dvm628e3/1/

The desired output is

The groupSpacing property helps me do this for each bar but not for every nth one.

I have tried selecting the groups and applying a transform but getting confused regarding groups and series and selecting the element of each bar to the transform is correctly applied.

d3.selectAll(".nv-group:nth-child(2)").attr("transform", "translate(35, 0)");

Thanks for advice/assistance

Leave an answer

Your email address will not be published. Required fields are marked *