Commit b6ada87f authored by Evgeny's avatar Evgeny

Fix problem with not normalizing when setting value

parent de097a2e
......@@ -90,12 +90,20 @@ c3_chart_fn.loadColumns = function(cols){
c3_chart_fn.setValue = function(id, i, value){
var $$ = this.internal;
var t = $$.api.data(id)[0];
var targets = $$.data._targets;
if(!t.values[i]){
var target;
targets.forEach(function(t){
if(t.id == id){
target = t
}
});
if(!target.values[i]){
$$.api.appendToColumn([id, value]);
} else {
t.values[i].value = value;
target.values[i].value = value;
$$.tuneAxis();
}
};
......
......@@ -378,6 +378,7 @@ c3_chart_internal_fn.tuneAxis = function(sync, callback){
// if we don't need to tune
if($$.config.normalized){
$$.data.targets = $$.normalize($$.data._targets);
$$.cachedRedraw();
return;
}
......
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