Update c3.js and c3.min.js

parent 2fe0603f
...@@ -3725,6 +3725,8 @@ ...@@ -3725,6 +3725,8 @@
} }
var data = []; var data = [];
data.noNegative = true;
targets.forEach(function(target){ targets.forEach(function(target){
data.push($$.cloneTarget(target)); data.push($$.cloneTarget(target));
...@@ -3733,7 +3735,12 @@ ...@@ -3733,7 +3735,12 @@
for(var k = 0; k < targets[0].values.length; k++) { for(var k = 0; k < targets[0].values.length; k++) {
var tt = 0; var tt = 0;
for(c in targets) { for(c in targets) {
tt = tt + targets[c].values[k].value; if(targets[c].values[k]){
if(targets[c].values[k].value < 0){
data.noNegative = false;
}
tt = tt + Math.abs(targets[c].values[k].value);
}
} }
tr[k] = tt; tr[k] = tt;
} }
...@@ -5044,8 +5051,10 @@ ...@@ -5044,8 +5051,10 @@
// if we don't need to tune // if we don't need to tune
if($$.config.normalized){ if($$.config.normalized){
$$.data.targets = $$.normalize($$.data._targets); $$.data.targets = $$.normalize($$.data._targets);
$$.cachedRedraw(); if($$.data.targets.noNegative){
return; $$.cachedRedraw();
return;
}
} }
var apply = function(){ var apply = function(){
......
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