fixed discrete bar chart y bleeding on ydomain min >0

master
Tyler Wolf 11 years ago
parent 9122285ae5
commit 45e5efa82c

@ -2,7 +2,7 @@
var nv = window.nv || {};
nv.version = '0.0.1a';
nv.version = '1.0.0b';
nv.dev = true //set false when in production
window.nv = nv;
@ -2408,7 +2408,7 @@ nv.models.discreteBar = function() {
})
.select('rect')
.attr('height', function(d,i) {
return Math.max(Math.abs(y(getY(d,i)) - y(0)) || 1)
return Math.max(Math.abs(y(getY(d,i)) - y((yDomain && yDomain[0]) || 0)) || 1)
});
@ -2629,7 +2629,7 @@ nv.models.discreteBarChart = function() {
//------------------------------------------------------------
// Setup Scales
x = discretebar.xScale();
x = discretebar.xScale().clamp(true);
y = discretebar.yScale();
//------------------------------------------------------------

14
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
var nv = window.nv || {};
nv.version = '0.0.1a';
nv.version = '1.0.0b';
nv.dev = true //set false when in production
window.nv = nv;

@ -208,7 +208,7 @@ nv.models.discreteBar = function() {
})
.select('rect')
.attr('height', function(d,i) {
return Math.max(Math.abs(y(getY(d,i)) - y(0)) || 1)
return Math.max(Math.abs(y(getY(d,i)) - y((yDomain && yDomain[0]) || 0)) || 1)
});

@ -102,7 +102,7 @@ nv.models.discreteBarChart = function() {
//------------------------------------------------------------
// Setup Scales
x = discretebar.xScale();
x = discretebar.xScale().clamp(true);
y = discretebar.yScale();
//------------------------------------------------------------

Loading…
Cancel
Save