I have a bar chart (stacked by not yet complete) and the columns are all grouping into the left of the chart. What is causing this?
Plnkr: https://plnkr.co/edit/DMRJfbD4ZF3xCiPdFedy?p=preview
data.forEach(function(d) {
var y0_positive = 0;
var y0_negative = 0;
d.components = keys.map(function(key) {
if (d[key] >= 0) {
// if we have a positive value, add to the postive
return {key: key, y1: y0_positive, y0: y0_positive += d[key] };
} else if (d[key] < 0) {
// if value is negative, add to the negative value
return {key: key, y0: y0_negative, y1: y0_negative += d[key] };
}
})
})
Kev