slight tweaks to scatterChart and css

master-patched
Bob Monteverde 12 years ago
parent 89172ff42e
commit 58de184cf9

@ -5943,7 +5943,7 @@ nv.models.scatterChart = function() {
, tooltips = true
, tooltipX = function(key, x, y) { return '<strong>' + x + '</strong>' }
, tooltipY = function(key, x, y) { return '<strong>' + y + '</strong>' }
, tooltip = function(key, x, y, e, graph) {
, tooltip = function(key, x, y, e, graph) {
return '<h3>' + key + '</h3>' +
'<p>' + y + ' at ' + x + '</p>'
}
@ -6025,10 +6025,7 @@ nv.models.scatterChart = function() {
var g = wrap.select('g')
// background for pointer events
gEnter.append('rect')
.attr('class', 'nvd3 background')
.attr('width', availableWidth)
.attr('height', availableHeight);
gEnter.append('rect').attr('class', 'nvd3 background')
gEnter.append('g').attr('class', 'x axis');
gEnter.append('g').attr('class', 'y axis');
@ -6069,6 +6066,11 @@ nv.models.scatterChart = function() {
}
g.select('.background')
.attr('width', availableWidth)
.attr('height', availableHeight);
scatter
.width(availableWidth)
.height(availableHeight)
@ -6129,7 +6131,6 @@ nv.models.scatterChart = function() {
g.select('.background').on('mousemove', updateFisheye);
g.select('.background').on('click', function() { pauseFisheye = !pauseFisheye; });
g.select('.point-paths').on('click', function() { pauseFisheye = !pauseFisheye; });
//g.select('.point-paths').on('mousemove', updateFisheye);
function updateFisheye() {
@ -6337,6 +6338,18 @@ nv.models.scatterChart = function() {
return chart;
};
chart.tooltipXContent = function(_) {
if (!arguments.length) return tooltipX;
tooltipX = _;
return chart;
};
chart.tooltipYContent = function(_) {
if (!arguments.length) return tooltipY;
tooltipY = _;
return chart;
};
//============================================================

4
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -10,13 +10,6 @@
overflow: hidden;
}
.nvd3.background {
fill: none;
/*
pointer-events: none;
*/
}
/********************
* TOOLTIP CSS
@ -94,13 +87,21 @@ svg {
svg text {
font: 12px sans-serif;
font: normal 12px sans-serif;
}
svg .title {
font: bold 14px Arial;
}
.nvd3 .background {
fill: none;
/*
pointer-events: none;
*/
}
/**********
* Brush
*/

@ -22,7 +22,7 @@ nv.models.scatterChart = function() {
, tooltips = true
, tooltipX = function(key, x, y) { return '<strong>' + x + '</strong>' }
, tooltipY = function(key, x, y) { return '<strong>' + y + '</strong>' }
, tooltip = function(key, x, y, e, graph) {
, tooltip = function(key, x, y, e, graph) {
return '<h3>' + key + '</h3>' +
'<p>' + y + ' at ' + x + '</p>'
}
@ -104,10 +104,7 @@ nv.models.scatterChart = function() {
var g = wrap.select('g')
// background for pointer events
gEnter.append('rect')
.attr('class', 'nvd3 background')
.attr('width', availableWidth)
.attr('height', availableHeight);
gEnter.append('rect').attr('class', 'nvd3 background')
gEnter.append('g').attr('class', 'x axis');
gEnter.append('g').attr('class', 'y axis');
@ -148,6 +145,11 @@ nv.models.scatterChart = function() {
}
g.select('.background')
.attr('width', availableWidth)
.attr('height', availableHeight);
scatter
.width(availableWidth)
.height(availableHeight)
@ -208,7 +210,6 @@ nv.models.scatterChart = function() {
g.select('.background').on('mousemove', updateFisheye);
g.select('.background').on('click', function() { pauseFisheye = !pauseFisheye; });
g.select('.point-paths').on('click', function() { pauseFisheye = !pauseFisheye; });
//g.select('.point-paths').on('mousemove', updateFisheye);
function updateFisheye() {
@ -416,6 +417,18 @@ nv.models.scatterChart = function() {
return chart;
};
chart.tooltipXContent = function(_) {
if (!arguments.length) return tooltipX;
tooltipX = _;
return chart;
};
chart.tooltipYContent = function(_) {
if (!arguments.length) return tooltipY;
tooltipY = _;
return chart;
};
//============================================================

Loading…
Cancel
Save