Merge branch 'master' into development

master
Robin Hu 11 years ago
commit 37ca61f8d1

@ -18,7 +18,7 @@
],
"license": "Apache License, v2.0",
"dependencies": {
"d3": "3.3.5"
"d3": "~3.3.5"
},
"ignore" : [
"**/.*",

@ -975,7 +975,8 @@ Most common instance is when the element is in a display:none; container.
Forumla is : text.length * font-size * constant_factor
*/
nv.utils.calcApproxTextWidth = function (svgTextElem) {
if (svgTextElem instanceof d3.selection) {
if (typeof svgTextElem.style === 'function'
&& typeof svgTextElem.text === 'function') {
var fontSize = parseInt(svgTextElem.style("font-size").replace("px",""));
var textLength = svgTextElem.text().length;

@ -109,7 +109,8 @@ Most common instance is when the element is in a display:none; container.
Forumla is : text.length * font-size * constant_factor
*/
nv.utils.calcApproxTextWidth = function (svgTextElem) {
if (svgTextElem instanceof d3.selection) {
if (typeof svgTextElem.style === 'function'
&& typeof svgTextElem.text === 'function') {
var fontSize = parseInt(svgTextElem.style("font-size").replace("px",""));
var textLength = svgTextElem.text().length;

Loading…
Cancel
Save