Commit 932b7fba authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix legend when svg is hidden - #468

parent 6a4d0179
......@@ -3010,14 +3010,14 @@
.style("fill-opacity", opacityForText));
};
c3_chart_internal_fn.getTextRect = function (text, cls) {
var rect;
this.svg.selectAll('.dummy')
var svg = this.d3.select('body').append("svg").style('visibility', 'hidden'), rect;
svg.selectAll('.dummy')
.data([text])
.enter().append('text')
.classed(cls ? cls : "", true)
.text(text)
.each(function () { rect = this.getBoundingClientRect(); })
.remove();
.each(function () { rect = this.getBoundingClientRect(); });
svg.remove();
return rect;
};
c3_chart_internal_fn.generateXYForText = function (areaIndices, barIndices, lineIndices, forX) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -48,14 +48,14 @@ c3_chart_internal_fn.addTransitionForText = function (transitions, xForText, yFo
.style("fill-opacity", opacityForText));
};
c3_chart_internal_fn.getTextRect = function (text, cls) {
var rect;
this.svg.selectAll('.dummy')
var svg = this.d3.select('body').append("svg").style('visibility', 'hidden'), rect;
svg.selectAll('.dummy')
.data([text])
.enter().append('text')
.classed(cls ? cls : "", true)
.text(text)
.each(function () { rect = this.getBoundingClientRect(); })
.remove();
.each(function () { rect = this.getBoundingClientRect(); });
svg.remove();
return rect;
};
c3_chart_internal_fn.generateXYForText = function (areaIndices, barIndices, lineIndices, forX) {
......
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