Commit ba260653 authored by Evgeny's avatar Evgeny

Fix problem with tuning axis

parent fccc553d
......@@ -587,7 +587,6 @@ c3_chart_internal_fn.findMinMax = function () {
var i,j, id;
var allData = $$.api.data();
allData.forEach(function(v){
var data;
if(v){
......@@ -637,9 +636,12 @@ c3_chart_internal_fn.findMinMax = function () {
for(var k = 0; k < tmp.length; k++){
s += tmp[k][j].value;
}
if (isUndefined(maxY) || s > maxY)
if (isUndefined(minY) || s < minY)
if (isUndefined(maxY) || s > maxY){
maxY = s;
}
if (isUndefined(minY) || s < minY){
minY = s;
}
}
}
} else {
......
......@@ -27,6 +27,8 @@ c3_chart_internal_fn.load = function (targets, args) {
// Set targets
$$.updateTargets($$.data.targets);
$$.tuneAxis();
// Redraw with new targets
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
......
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