Commit d35f0f8b authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix unexpected height when redraw - #942

parent cd11b6c3
...@@ -3263,7 +3263,7 @@ ...@@ -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 @@ ...@@ -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();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -298,7 +298,7 @@ c3_chart_internal_fn.getMaxTickWidth = function (id, withoutRecompute) { ...@@ -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();
......
...@@ -49,7 +49,7 @@ c3_chart_internal_fn.redrawText = function (xForText, yForText, forFlow, withTra ...@@ -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')
......
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