Skip to content Skip to sidebar Skip to footer

D3 Bar Chart - Last Bar Overhangs The End Of The X Axis

I have a D3 stacked bar chart that is working great except that the last bar overhangs the right side of X axis and the left side of the axis is not touching the Y axis. This is b

Solution 1:

The main problem was that you had a clip path in your SVG that clipped parts of the plotting region. Once that is removed, you can see the full graph, but the first and last bars will still "hang" over the ends of the axis.

To change that, you have to extend the axis, e.g. by adding a day or two either way when computing the minimum and maximum for the scale.

Post a Comment for "D3 Bar Chart - Last Bar Overhangs The End Of The X Axis"