Fixed bug in tooltip.js, for situations where parentContainer is undefined.

Added tooltip.js script to pieChartTest.html
master
Robin Hu 11 years ago
parent 16d0a843fc
commit 281f6cfbce

@ -624,8 +624,10 @@ window.nv.tooltip.* also has various helper methods.
body.appendChild(container);
//If the parent container is an overflow <div> with scrollbars, subtract the scroll offsets.
pos[0] = pos[0] - parentContainer.scrollLeft;
pos[1] = pos[1] - parentContainer.scrollTop;
if (parentContainer) {
pos[0] = pos[0] - parentContainer.scrollLeft;
pos[1] = pos[1] - parentContainer.scrollTop;
}
nv.tooltip.calcTooltipPosition(pos, gravity, dist, container);
};
@ -2467,8 +2469,13 @@ nv.models.cumulativeLineChart = function() {
function updateZero() {
indexLine
.data([index]);
//When dragging the index line, turn off line transitions.
// Then turn them back on when done dragging.
var oldDuration = chart.transitionDuration();
chart.transitionDuration(0);
container.call(chart);
chart.transitionDuration(oldDuration);
}
g.select('.nv-background rect')

12
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -287,8 +287,10 @@ window.nv.tooltip.* also has various helper methods.
body.appendChild(container);
//If the parent container is an overflow <div> with scrollbars, subtract the scroll offsets.
pos[0] = pos[0] - parentContainer.scrollLeft;
pos[1] = pos[1] - parentContainer.scrollTop;
if (parentContainer) {
pos[0] = pos[0] - parentContainer.scrollLeft;
pos[1] = pos[1] - parentContainer.scrollTop;
}
nv.tooltip.calcTooltipPosition(pos, gravity, dist, container);
};

@ -60,6 +60,7 @@ text {
<script src="../lib/d3.v3.js"></script>
<script src="../nv.d3.js"></script>
<script src="../src/tooltip.js"></script>
<script src="../src/models/legend.js"></script>
<script src="../src/models/pie.js"></script>
<script src="../src/models/pieChart.js"></script>

Loading…
Cancel
Save