Browse Source

Fix svgLeft - #52

pull/66/head
Masayuki Tanaka 11 years ago
parent
commit
217d98381c
  1. 8
      c3.js
  2. 2
      c3.min.js

8
c3.js

@ -296,8 +296,9 @@
innerRadius = hasDonutType(c3.data.targets) ? radius * 0.6 : 0;
}
function getSvgLeft() {
var svgLeft = svg.property('offsetLeft');
return svgLeft ? svgLeft : 0;
var svgRect = d3.select('.y.axis').node().getBoundingClientRect(),
chartRect = d3.select(__bindto).node().getBoundingClientRect();
return svgRect.right - chartRect.left - getCurrentPaddingLeft();
}
function getCurrentWidth() {
return __size_width ? __size_width : getParentWidth();
@ -1064,7 +1065,8 @@
tHeight = tooltip.property('offsetHeight');
// Determin tooltip position
if (__axis_rotated) {
tooltipLeft = mouse[0] + 100;
svgLeft = getSvgLeft();
tooltipLeft = svgLeft + mouse[0] + 100;
tooltipRight = tooltipLeft + tWidth;
chartRight = getCurrentWidth() - getCurrentPaddingRight();
tooltipTop = x(dataToShow[0].x) + 20;

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save