Change stacking algorithm for bar

parent a9425b8d
......@@ -41,7 +41,11 @@ c3_chart_internal_fn.getShapeOffset = function (typeFilter, indices, isSub) {
var values = $$.isStepType(d) ? $$.convertValuesToStep(t.values) : t.values;
if (t.id === d.id || indices[t.id] !== indices[d.id]) { return; }
if (targetIds.indexOf(t.id) < targetIds.indexOf(d.id)) {
if (values[i]) {
var shouldStack = i in values &&
(!$$.isBarType(d) ||
values[i].value * d.value >= 0);
if (shouldStack) {
offset += scale(values[i].value) - y0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment