Commit 4c193b03 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Merge pull request #1275 from ggamir/patch-1

Allow data series with unequal amount of x-values
parents 25a5f39f 034fad22
......@@ -41,10 +41,25 @@ 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)) {
// check if the x values line up
if (typeof values[i] === 'undefined' ||
(values[i].x !== d.x) && (values[i].x - d.x !== 0)) {
// if not, try to find the value that does line up
i = -1;
for (var j in values) {
if ((values[j].x === d.x) || (values[j].x - d.x === 0)) {
i = j;
break;
}
}
}
if (i in values) {
if (values[i].value * d.value >= 0) {
offset += scale(values[i].value) - y0;
}
}
}
});
return offset;
};
......
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