PMSI-AlignAlytics/dimple — pull request #49 by fjsj (2014-02-13 20:35:20+00:00)
Title: Tooltip fixes

Two fixes:
- Using .getBBox to get SVG width/height: using `parseFloat(chart.svg.attr("width"))` is wrong, because it will return `100` if svg width is set to `100%`.
- Don't draw tooltips with negative X: if the tooltip width `w` is larger than `selectedShape` width, then `(x + (width / 2) - (2 * textMargin + w) / 2)` will be negative. So we must have a condition to detect if this value is negative, to avoid drawing part of the tooltip outside SVG.