Commit 069a6491 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix bug for xy and timeseries load

parent a4805bcb
......@@ -1338,11 +1338,16 @@
// save x for update data by load when custom x and c3.x API
ids.forEach(function (id) {
var xKey = getXKey(id);
var xKey = getXKey(id), idsForX = Object.keys(c3.data.x);
if (isCustomX || isTimeSeries) {
if (xs.indexOf(xKey) >= 0) {
c3.data.x[id] = data.map(function (d) { return d[xKey]; });
}
// Use other id's x when same x (data.x option) specified.
else if (__data_x && idsForX.length > 0) {
c3.data.x[id] = c3.data.x[idsForX[0]];
}
// MEMO: if no x included, use same x of current will be used
} else {
c3.data.x[id] = data.map(function (d, i) { return i; });
......
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