Fixed issue with points in sparkline multiplying on update

This commit is contained in:
Bob Monteverde 2012-10-23 14:12:02 -04:00
parent 751b7e661d
commit 1a878bed85
4 changed files with 9 additions and 8 deletions

View File

@ -40,6 +40,7 @@ nv.addGraph(function() {
.transition().duration(250)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});

View File

@ -9471,15 +9471,15 @@ nv.models.sparkline = function() {
})
.filter(function(d) { return typeof d.pointIndex != 'undefined' })
});
points.enter().append('circle').attr('class', 'nv-point');
points.enter().append('circle');
points.exit().remove();
points
.attr('cx', function(d,i) { return x(getX(d,d.pointIndex)) })
.attr('cy', function(d,i) { return y(getY(d,d.pointIndex)) })
.attr('r', 2)
.attr('class', function(d,i) {
return getX(d, d.pointIndex) == x.domain()[1] ? 'nv-currentValue' :
getY(d, d.pointIndex) == y.domain()[0] ? 'nv-minValue' : 'nv-maxValue'
return getX(d, d.pointIndex) == x.domain()[1] ? 'nv-point nv-currentValue' :
getY(d, d.pointIndex) == y.domain()[0] ? 'nv-point nv-minValue' : 'nv-point nv-maxValue'
});
});

4
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -74,15 +74,15 @@ nv.models.sparkline = function() {
})
.filter(function(d) { return typeof d.pointIndex != 'undefined' })
});
points.enter().append('circle').attr('class', 'nv-point');
points.enter().append('circle');
points.exit().remove();
points
.attr('cx', function(d,i) { return x(getX(d,d.pointIndex)) })
.attr('cy', function(d,i) { return y(getY(d,d.pointIndex)) })
.attr('r', 2)
.attr('class', function(d,i) {
return getX(d, d.pointIndex) == x.domain()[1] ? 'nv-currentValue' :
getY(d, d.pointIndex) == y.domain()[0] ? 'nv-minValue' : 'nv-maxValue'
return getX(d, d.pointIndex) == x.domain()[1] ? 'nv-point nv-currentValue' :
getY(d, d.pointIndex) == y.domain()[0] ? 'nv-point nv-minValue' : 'nv-point nv-maxValue'
});
});