Added nv-legend-* class to legend text and circle icon.

Fixing some IE bugs related to the tooltip.
master
Robin Hu 11 years ago
parent 8b4a0b6cd9
commit c2cc7772d1

@ -51,6 +51,7 @@ nv.interactiveGuideline = function() {
var mouseX = d3mouse[0];
var mouseY = d3mouse[1];
var subtractMargin = true;
var mouseOutAnyReason = false;
if (isMSIE) {
/*
D3.js (or maybe SVG.getScreenCTM) has a nasty bug in Internet Explorer 10.
@ -73,6 +74,9 @@ nv.interactiveGuideline = function() {
*/
if(d3.event.target.tagName !== "svg")
subtractMargin = false;
if (d3.event.target.className.baseVal.match("nv-legend"))
mouseOutAnyReason = true;
}
@ -87,6 +91,7 @@ nv.interactiveGuideline = function() {
if (mouseX < 0 || mouseY < 0
|| mouseX > availableWidth || mouseY > availableHeight
|| (d3.event.relatedTarget && d3.event.relatedTarget.ownerSVGElement === undefined)
|| mouseOutAnyReason
)
{
if (isMSIE) {

@ -84,9 +84,11 @@ nv.models.legend = function() {
});
seriesEnter.append('circle')
.style('stroke-width', 2)
.attr('class','nv-legend-symbol')
.attr('r', 5);
seriesEnter.append('text')
.attr('text-anchor', 'start')
.attr('class','nv-legend-text')
.attr('dy', '.32em')
.attr('dx', '8');
series.classed('disabled', function(d) { return d.disabled });

@ -128,6 +128,7 @@ window.nv.tooltip.* also has various helper methods.
container.node().innerHTML = newContent;
container.style("top",0).style("left",0).style("opacity",0);
container.selectAll("div, table, td, tr").classed(nvPointerEventsClass,true)
container.classed(nvPointerEventsClass,true);
return container.node();
}

@ -120,7 +120,7 @@
<script>
//------------ CHART 1
defaultChartConfig("chart1", dummyStocks(),true, true);
defaultChartConfig("chart1", dummyStocks(),true, true, {forceY:false});
//-------------- CHART 2 --- Chart without the interactive guideline.
nv.addGraph(function() {
@ -187,6 +187,9 @@ function defaultChartConfig(containerid, data, guideline, useDates, auxOptions)
if (auxOptions.height)
chart.height(auxOptions.height);
if (auxOptions.forceY)
chart.forceY([0]);
var formatter;
if (useDates !== undefined) {
formatter = function(d,i) {

Loading…
Cancel
Save