Update c3.js and c3.min.js

parent 000601ce
...@@ -1715,7 +1715,10 @@ ...@@ -1715,7 +1715,10 @@
}; };
c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) { c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
var $$ = this, config = $$.config, var $$ = this, config = $$.config,
targetsByAxisId = targets.filter(function (t) { return $$.getAxisId(t.id) === axisId; }), targetsByAxisId = targets.filter(function (t) {
if($$.getAxisId(t.id) !== axisId) return false;
return !!t.values.length;
}),
yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId, yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId,
yMin = axisId === 'y2' ? config.axis_y2_min : config.axis_y_min, yMin = axisId === 'y2' ? config.axis_y2_min : config.axis_y_min,
yMax = axisId === 'y2' ? config.axis_y2_max : config.axis_y_max, yMax = axisId === 'y2' ? config.axis_y2_max : config.axis_y_max,
...@@ -2025,9 +2028,10 @@ ...@@ -2025,9 +2028,10 @@
}; };
c3_chart_internal_fn.getEdgeX = function (targets) { c3_chart_internal_fn.getEdgeX = function (targets) {
var $$ = this; var $$ = this;
return !targets.length ? [0, 0] : [ var filtered = targets.filter(function(t){ return !!t.values.length; });
$$.d3.min(targets, function (t) { return t.values[0].x; }), return !filtered.length ? [0, 0] : [
$$.d3.max(targets, function (t) { return t.values[t.values.length - 1].x; }) $$.d3.min(filtered, function (t) { return t.values[0].x; }),
$$.d3.max(filtered, function (t) { return t.values[t.values.length - 1].x; })
]; ];
}; };
c3_chart_internal_fn.mapToIds = function (targets) { c3_chart_internal_fn.mapToIds = function (targets) {
...@@ -2344,6 +2348,13 @@ ...@@ -2344,6 +2348,13 @@
new_rows[j - 1][key] = columns[i][j]; new_rows[j - 1][key] = columns[i][j];
} }
} }
if(!new_rows.length){
new_rows.empty = true;
new_rows[0] = {};
for (i = 0; i < columns.length; i++) {
new_rows[0][columns[i][0]] = undefined;
}
}
return new_rows; return new_rows;
}; };
c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) { c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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