Browse Source

Fix unexpected height when redraw - #942

pull/990/head
Masayuki Tanaka 10 years ago
parent
commit
d35f0f8bfd
  1. 4
      c3.js
  2. 2
      c3.min.js
  3. 2
      src/axis.js
  4. 2
      src/text.js

4
c3.js

@ -3263,7 +3263,7 @@
}; };
c3_chart_internal_fn.getTextRect = function (text, cls) { c3_chart_internal_fn.getTextRect = function (text, cls) {
var body = this.d3.select('body').classed('c3', true), var body = this.d3.select('body').classed('c3', true),
svg = body.append("svg").style('visibility', 'hidden'), rect; svg = body.append("svg").style('visibility', 'hidden').style('height', 0), rect;
svg.selectAll('.dummy') svg.selectAll('.dummy')
.data([text]) .data([text])
.enter().append('text') .enter().append('text')
@ -4391,7 +4391,7 @@
$$.updateXAxisTickValues(targetsToShow, axis); $$.updateXAxisTickValues(targetsToShow, axis);
} }
body = this.d3.select('body').classed('c3', true); body = this.d3.select('body').classed('c3', true);
svg = body.append('svg').style('visibility', 'hidden'); svg = body.append('svg').style('visibility', 'hidden').style('height', 0);
svg.append('g').call(axis).each(function () { svg.append('g').call(axis).each(function () {
$$.d3.select(this).selectAll('text tspan').each(function () { $$.d3.select(this).selectAll('text tspan').each(function () {
var box = this.getBoundingClientRect(); var box = this.getBoundingClientRect();

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
src/axis.js

@ -298,7 +298,7 @@ c3_chart_internal_fn.getMaxTickWidth = function (id, withoutRecompute) {
$$.updateXAxisTickValues(targetsToShow, axis); $$.updateXAxisTickValues(targetsToShow, axis);
} }
body = this.d3.select('body').classed('c3', true); body = this.d3.select('body').classed('c3', true);
svg = body.append('svg').style('visibility', 'hidden'); svg = body.append('svg').style('visibility', 'hidden').style('height', 0);
svg.append('g').call(axis).each(function () { svg.append('g').call(axis).each(function () {
$$.d3.select(this).selectAll('text tspan').each(function () { $$.d3.select(this).selectAll('text tspan').each(function () {
var box = this.getBoundingClientRect(); var box = this.getBoundingClientRect();

2
src/text.js

@ -49,7 +49,7 @@ c3_chart_internal_fn.redrawText = function (xForText, yForText, forFlow, withTra
}; };
c3_chart_internal_fn.getTextRect = function (text, cls) { c3_chart_internal_fn.getTextRect = function (text, cls) {
var body = this.d3.select('body').classed('c3', true), var body = this.d3.select('body').classed('c3', true),
svg = body.append("svg").style('visibility', 'hidden'), rect; svg = body.append("svg").style('visibility', 'hidden').style('height', 0), rect;
svg.selectAll('.dummy') svg.selectAll('.dummy')
.data([text]) .data([text])
.enter().append('text') .enter().append('text')

Loading…
Cancel
Save