Browse Source

Merge pull request #1294 from daxfohl/master

Bugfix 1292, 1246 by making subchart axis hidden if subchart is hidden
pull/1220/merge
Masayuki Tanaka 9 years ago
parent
commit
f5da05e18a
  1. 7
      c3.js
  2. 10
      c3.min.js
  3. 7
      src/subchart.js

7
c3.js

@ -5375,9 +5375,10 @@
}; };
c3_chart_internal_fn.initSubchart = function () { c3_chart_internal_fn.initSubchart = function () {
var $$ = this, config = $$.config, var $$ = this, config = $$.config,
context = $$.context = $$.svg.append("g").attr("transform", $$.getTranslate('context')); context = $$.context = $$.svg.append("g").attr("transform", $$.getTranslate('context')),
visibility = config.subchart_show ? 'visible' : 'hidden';
context.style('visibility', config.subchart_show ? 'visible' : 'hidden'); context.style('visibility', visibility);
// Define g for chart area // Define g for chart area
context.append('g') context.append('g')
@ -5404,7 +5405,7 @@
.attr("class", CLASS.axisX) .attr("class", CLASS.axisX)
.attr("transform", $$.getTranslate('subx')) .attr("transform", $$.getTranslate('subx'))
.attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis) .attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis)
.style("visibility", config.subchart_axis_x_show ? 'visible' : 'hidden'); .style("visibility", config.subchart_axis_x_show ? visibility : 'hidden');
}; };
c3_chart_internal_fn.updateTargetsForSubchart = function (targets) { c3_chart_internal_fn.updateTargetsForSubchart = function (targets) {
var $$ = this, context = $$.context, config = $$.config, var $$ = this, context = $$.context, config = $$.config,

10
c3.min.js vendored

File diff suppressed because one or more lines are too long

7
src/subchart.js

@ -11,9 +11,10 @@ c3_chart_internal_fn.initBrush = function () {
}; };
c3_chart_internal_fn.initSubchart = function () { c3_chart_internal_fn.initSubchart = function () {
var $$ = this, config = $$.config, var $$ = this, config = $$.config,
context = $$.context = $$.svg.append("g").attr("transform", $$.getTranslate('context')); context = $$.context = $$.svg.append("g").attr("transform", $$.getTranslate('context')),
visibility = config.subchart_show ? 'visible' : 'hidden';
context.style('visibility', config.subchart_show ? 'visible' : 'hidden'); context.style('visibility', visibility);
// Define g for chart area // Define g for chart area
context.append('g') context.append('g')
@ -40,7 +41,7 @@ c3_chart_internal_fn.initSubchart = function () {
.attr("class", CLASS.axisX) .attr("class", CLASS.axisX)
.attr("transform", $$.getTranslate('subx')) .attr("transform", $$.getTranslate('subx'))
.attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis) .attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis)
.style("visibility", config.subchart_axis_x_show ? 'visible' : 'hidden'); .style("visibility", config.subchart_axis_x_show ? visibility : 'hidden');
}; };
c3_chart_internal_fn.updateTargetsForSubchart = function (targets) { c3_chart_internal_fn.updateTargetsForSubchart = function (targets) {
var $$ = this, context = $$.context, config = $$.config, var $$ = this, context = $$.context, config = $$.config,

Loading…
Cancel
Save