Commit cd43dfc3 authored by Evgeny's avatar Evgeny

chart.axis* API. Return 19100.config.axis_*_show if value === undefined

parent 100ea2c0
...@@ -7957,6 +7957,10 @@ ...@@ -7957,6 +7957,10 @@
c3_chart_fn.axisX = function (value){ c3_chart_fn.axisX = function (value){
var $$ = this.internal; var $$ = this.internal;
if(value === undefined){
return $$.config.axis_x_show;
}
$$.config.axis_x_show = !!value; $$.config.axis_x_show = !!value;
$$.axes.x.style("visibility", $$.config.axis_x_show ? 'visible' : 'hidden'); $$.axes.x.style("visibility", $$.config.axis_x_show ? 'visible' : 'hidden');
...@@ -7965,6 +7969,10 @@ ...@@ -7965,6 +7969,10 @@
}; };
c3_chart_fn.axisY = function (value){ c3_chart_fn.axisY = function (value){
var $$ = this.internal; var $$ = this.internal;
if(value === undefined){
return $$.config.axis_y_show;
}
$$.config.axis_y_show = !!value; $$.config.axis_y_show = !!value;
$$.axes.y.style("visibility", $$.config.axis_y_show ? 'visible' : 'hidden'); $$.axes.y.style("visibility", $$.config.axis_y_show ? 'visible' : 'hidden');
...@@ -7974,7 +7982,13 @@ ...@@ -7974,7 +7982,13 @@
c3_chart_fn.axisY2 = function(value){ c3_chart_fn.axisY2 = function(value){
var $$ = this.internal; var $$ = this.internal;
if(value === undefined){
console.log(value, $$.config.axis_y2_show);
return $$.config.axis_y2_show;
}
$$.config.axis_y2_show = !!value; $$.config.axis_y2_show = !!value;
console.log(value, $$.config.axis_y2_show);
$$.axes.y2.style("visibility", $$.config.axis_y2_show ? 'visible' : 'hidden'); $$.axes.y2.style("visibility", $$.config.axis_y2_show ? 'visible' : 'hidden');
$$.redraw(); $$.redraw();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -85,6 +85,10 @@ c3_chart_fn.axis.yFormat = function(value){ ...@@ -85,6 +85,10 @@ c3_chart_fn.axis.yFormat = function(value){
c3_chart_fn.axisX = function (value){ c3_chart_fn.axisX = function (value){
var $$ = this.internal; var $$ = this.internal;
if(value === undefined){
return $$.config.axis_x_show;
}
$$.config.axis_x_show = !!value; $$.config.axis_x_show = !!value;
$$.axes.x.style("visibility", $$.config.axis_x_show ? 'visible' : 'hidden'); $$.axes.x.style("visibility", $$.config.axis_x_show ? 'visible' : 'hidden');
...@@ -93,6 +97,10 @@ c3_chart_fn.axisX = function (value){ ...@@ -93,6 +97,10 @@ c3_chart_fn.axisX = function (value){
}; };
c3_chart_fn.axisY = function (value){ c3_chart_fn.axisY = function (value){
var $$ = this.internal; var $$ = this.internal;
if(value === undefined){
return $$.config.axis_y_show;
}
$$.config.axis_y_show = !!value; $$.config.axis_y_show = !!value;
$$.axes.y.style("visibility", $$.config.axis_y_show ? 'visible' : 'hidden'); $$.axes.y.style("visibility", $$.config.axis_y_show ? 'visible' : 'hidden');
...@@ -102,6 +110,10 @@ c3_chart_fn.axisY = function (value){ ...@@ -102,6 +110,10 @@ c3_chart_fn.axisY = function (value){
c3_chart_fn.axisY2 = function(value){ c3_chart_fn.axisY2 = function(value){
var $$ = this.internal; var $$ = this.internal;
if(value === undefined){
return $$.config.axis_y2_show;
}
$$.config.axis_y2_show = !!value; $$.config.axis_y2_show = !!value;
$$.axes.y2.style("visibility", $$.config.axis_y2_show ? 'visible' : 'hidden'); $$.axes.y2.style("visibility", $$.config.axis_y2_show ? 'visible' : 'hidden');
......
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