0
votes

I'm having trouble getting the stacked bar chart to redraw when I update the data. I can make the chart read the new data and remove the missing block but I can't figure out how to get it to fill in the empty portion. I have it working with the Stacked Area and Line charts but roadblock on the stacked column/bar.

My working fiddle is here: http://jsfiddle.net/adeaver/duvpM/8/

and I do have the block.exit().remove(); aspect in place.

Any guidance would be appreciated.

1

1 Answers

1
votes

You are not adding any new data to fill the gap or expanding the existing data to do the same. As you are giving the coordinates for the stacked bars in the data and don't calculate them based on e.g. proportions in the data, there is nothing that would make D3 fill the gap.

Here is an example that computes the stacks in the code that you may find helpful. It looks to me like you would want to change your example to calculate the size of each bar based on a relative value.