This commit is contained in:
Marsup 2012-09-14 14:51:31 +02:00
parent dffe67d4dc
commit 4ae1745274
3 changed files with 8 additions and 15 deletions

View File

@ -3339,9 +3339,8 @@ nv.models.line = function() {
var areaPaths = groups.selectAll('path.nv-area')
.data(function(d) { return [d] }); // this is done differently than lines because I need to check if series is an area
.data(function(d) { return isArea(d) ? [d] : [] }); // this is done differently than lines because I need to check if series is an area
areaPaths.enter().append('path')
.filter(isArea)
.attr('class', 'nv-area')
.attr('d', function(d) {
return d3.svg.area()
@ -3353,7 +3352,6 @@ nv.models.line = function() {
//.y1(function(d,i) { return y0(0) }) //assuming 0 is within y domain.. may need to tweak this
.apply(this, [d.values])
});
groups.selectAll('path:not(.nv-area):not(.nv-line)').remove(); // attempting to fix issue #198
d3.transition(groups.exit().selectAll('path.nv-area'))
.attr('d', function(d) {
return d3.svg.area()
@ -3365,7 +3363,7 @@ nv.models.line = function() {
//.y1(function(d,i) { return y0(0) }) //assuming 0 is within y domain.. may need to tweak this
.apply(this, [d.values])
});
d3.transition(areaPaths.filter(isArea))
d3.transition(areaPaths)
.attr('d', function(d) {
return d3.svg.area()
.interpolate(interpolate)
@ -3390,7 +3388,6 @@ nv.models.line = function() {
.x(function(d,i) { return x0(getX(d,i)) })
.y(function(d,i) { return y0(getY(d,i)) })
);
groups.selectAll('path:not(.nv-area):not(.nv-line)').remove(); // attempting to fix issue #198
d3.transition(groups.exit().selectAll('path.nv-line'))
.attr('d',
d3.svg.line()

9
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -124,9 +124,8 @@ nv.models.line = function() {
var areaPaths = groups.selectAll('path.nv-area')
.data(function(d) { return [d] }); // this is done differently than lines because I need to check if series is an area
.data(function(d) { return isArea(d) ? [d] : [] }); // this is done differently than lines because I need to check if series is an area
areaPaths.enter().append('path')
.filter(isArea)
.attr('class', 'nv-area')
.attr('d', function(d) {
return d3.svg.area()
@ -138,7 +137,6 @@ nv.models.line = function() {
//.y1(function(d,i) { return y0(0) }) //assuming 0 is within y domain.. may need to tweak this
.apply(this, [d.values])
});
groups.selectAll('path:not(.nv-area):not(.nv-line)').remove(); // attempting to fix issue #198
d3.transition(groups.exit().selectAll('path.nv-area'))
.attr('d', function(d) {
return d3.svg.area()
@ -150,7 +148,7 @@ nv.models.line = function() {
//.y1(function(d,i) { return y0(0) }) //assuming 0 is within y domain.. may need to tweak this
.apply(this, [d.values])
});
d3.transition(areaPaths.filter(isArea))
d3.transition(areaPaths)
.attr('d', function(d) {
return d3.svg.area()
.interpolate(interpolate)
@ -175,7 +173,6 @@ nv.models.line = function() {
.x(function(d,i) { return x0(getX(d,i)) })
.y(function(d,i) { return y0(getY(d,i)) })
);
groups.selectAll('path:not(.nv-area):not(.nv-line)').remove(); // attempting to fix issue #198
d3.transition(groups.exit().selectAll('path.nv-line'))
.attr('d',
d3.svg.line()