|
|
|
@ -748,8 +748,7 @@ nv.models.historicalBar = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var barsEnter = bars.enter().append('rect')
|
|
|
|
|
.attr('class', function(d,i,j) { return (getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive') + ' nv-bar-' + j + '-' + i })
|
|
|
|
|
.attr('fill', function(d,i) { return color(d, i); })
|
|
|
|
|
//.attr('class', function(d,i,j) { return (getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive') + ' nv-bar-' + j + '-' + i })
|
|
|
|
|
.attr('x', 0 )
|
|
|
|
|
.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })
|
|
|
|
|
.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) })
|
|
|
|
@ -801,6 +800,7 @@ nv.models.historicalBar = function() {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
bars
|
|
|
|
|
.attr('fill', function(d,i) { return color(d, i); })
|
|
|
|
|
.attr('class', function(d,i,j) { return (getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive') + ' nv-bar-' + j + '-' + i })
|
|
|
|
|
.attr('transform', function(d,i) { return 'translate(' + (x(getX(d,i)) - ((availableWidth / data[0].values.length) * .5)) + ',0)'; }) //TODO: better width calculations that don't assume always uniform data spacing;w
|
|
|
|
|
.attr('width', (availableWidth / data[0].values.length) * .9 )
|
|
|
|
|