Fixed historical bar position, bars are now centered over ticks
This commit is contained in:
parent
dbc0da6a66
commit
eabda14d91
2
nv.d3.js
2
nv.d3.js
@ -902,7 +902,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('transform', function(d,i) { return 'translate(' + (x(getX(d,i)) - ((availableWidth / data[0].values.length) * .45)) + ',0)'; }) //TODO: better width calculations that don't assume always uniform data spacing;w
|
||||
.attr('width', (availableWidth / data[0].values.length) * .9 )
|
||||
|
||||
|
||||
|
2
nv.d3.min.js
vendored
2
nv.d3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -156,7 +156,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('transform', function(d,i) { return 'translate(' + (x(getX(d,i)) - ((availableWidth / data[0].values.length) * .45)) + ',0)'; }) //TODO: better width calculations that don't assume always uniform data spacing;w
|
||||
.attr('width', (availableWidth / data[0].values.length) * .9 )
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user