Fixed issue with points in sparkline multiplying on update
This commit is contained in:
parent
751b7e661d
commit
1a878bed85
@ -40,6 +40,7 @@ nv.addGraph(function() {
|
||||
.transition().duration(250)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
6
nv.d3.js
6
nv.d3.js
@ -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
4
nv.d3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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'
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user