Commit c6169af2 authored by Evgeny's avatar Evgeny

Extend chart.dataType API to set type

parent cd43dfc3
......@@ -7799,9 +7799,13 @@
return t.values;
};
c3_chart_fn.dataType = function(id) {
c3_chart_fn.dataType = function(id, type) {
var $$ = this.internal;
return $$.config.data_types[id];
if(type){
$$.config.data_types[id] = type;
} else {
return $$.config.data_types[id];
}
};
c3_chart_fn.dataColor = function(id, value) {
......@@ -7983,12 +7987,10 @@
var $$ = this.internal;
if(value === undefined){
console.log(value, $$.config.axis_y2_show);
return $$.config.axis_y2_show;
}
$$.config.axis_y2_show = !!value;
console.log(value, $$.config.axis_y2_show);
$$.axes.y2.style("visibility", $$.config.axis_y2_show ? 'visible' : 'hidden');
$$.redraw();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -35,9 +35,13 @@ c3_chart_fn.getDataById = function(seqId){
return t.values;
};
c3_chart_fn.dataType = function(id) {
c3_chart_fn.dataType = function(id, type) {
var $$ = this.internal;
return $$.config.data_types[id];
if(type){
$$.config.data_types[id] = type;
} else {
return $$.config.data_types[id];
}
};
c3_chart_fn.dataColor = function(id, value) {
......
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