From 5f5c298ec741437a8e9cd8879b9c24216beb1a3d Mon Sep 17 00:00:00 2001 From: Robin Hu Date: Fri, 12 Jul 2013 23:33:38 -0400 Subject: [PATCH] Fixing line chart with SVG resize tooltip issues. --- examples/lineChartSVGResize.html | 2 +- src/tooltip.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/lineChartSVGResize.html b/examples/lineChartSVGResize.html index 84dbd86..51d8175 100644 --- a/examples/lineChartSVGResize.html +++ b/examples/lineChartSVGResize.html @@ -23,7 +23,7 @@ svg { Zoom In Zoom Out -
+
diff --git a/src/tooltip.js b/src/tooltip.js index a2bd66d..77dab40 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -90,6 +90,9 @@ window.nv.tooltip.* also has various helper methods. function convertViewBoxRatio() { if (chartContainer) { var svg = d3.select(chartContainer); + if (svg.node().tagName !== "svg") { + svg = svg.select("svg"); + } var viewBox = (svg.node()) ? svg.attr('viewBox') : null; if (viewBox) { viewBox = viewBox.split(' ');