Putting back chart.container=this, in scatterChart.js.

A third party function we are using was referencing this property.
master
Robin Hu 11 years ago
parent 688518f7f1
commit c801cf2733

@ -138,7 +138,7 @@ nv.interactiveGuideline = function() {
//Private variables
var previousXCoordinate = null
isMSIE = navigator.userAgent.indexOf("MSIE") !== -1
isMSIE = navigator.userAgent.indexOf("MSIE") !== -1 //Check user-agent for Microsoft Internet Explorer.
;
@ -174,18 +174,16 @@ nv.interactiveGuideline = function() {
var mouseX = d3mouse[0];
var mouseY = d3mouse[1];
if (isMSIE && (mouseX < 0) || (mouseY < 0)) {
if (isMSIE) {
/*
D3.js (or maybe SVG.getScreenCTM) has a nasty bug in Internet Explorer.
D3.js (or maybe SVG.getScreenCTM) has a nasty bug in Internet Explorer 10.
d3.mouse() returns incorrect X,Y mouse coordinates when mouse moving
over a rect in IE. THe coordinates are off by 25% of the element's offsetLeft position.
For instance, if the <rect> is 100px left of the screen, the left most mouse point returned
will be -25 on IE. This hack solves the problem.
over a rect in IE 10.
However, d3.event.offsetX/Y also returns the mouse coordinates
relative to the triggering <rect>. So we use offsetX/Y on IE.
*/
var offsetLeft = offsetParent.getBoundingClientRect().left;
var offsetTop = offsetParent.getBoundingClientRect().top;
mouseX = mouseX + 0.25 * offsetLeft;
mouseY = mouseY + 0.25 * offsetTop;
mouseX = d3.event.offsetX;
mouseY = d3.event.offsetY;
}
var pointXValue = xScale.invert(mouseX);
@ -203,7 +201,7 @@ nv.interactiveGuideline = function() {
if (isMSIE) {
/*
On IE9+, the pointer-events property does not work for DIV's (it does on Chrome, FireFox).
On IE 9+, the pointer-events property does not work for DIV's (it does on Chrome, FireFox).
So the result is, when you mouse over this interactive layer, and then mouse over a tooltip,
the mouseout event is called, causing the tooltip to disappear. This causes very buggy behavior.
To bypass this, only on IE, we check d3.event.relatedTarget. If this is equal to anything in the tooltip,
@ -406,6 +404,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(' ');
@ -436,7 +437,7 @@ window.nv.tooltip.* also has various helper methods.
container.node().innerHTML = newContent;
container.style("top",0).style("left",0);
container.style("top",0).style("left",0).style("opacity",0);
return container.node();
}
@ -11381,7 +11382,7 @@ nv.models.scatterChart = function() {
- margin.top - margin.bottom;
chart.update = function() { container.transition().call(chart); };
// chart.container = this;
chart.container = this;
//set state.disabled
state.disabled = data.map(function(d) { return !!d.disabled });

12
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -107,7 +107,7 @@ nv.models.scatterChart = function() {
- margin.top - margin.bottom;
chart.update = function() { container.transition().call(chart); };
// chart.container = this;
chart.container = this;
//set state.disabled
state.disabled = data.map(function(d) { return !!d.disabled });

Loading…
Cancel
Save