Issue #235 fixed issue with text-anchor not being set to middle on x axis max and min values

master-patched
Bob Monteverde 12 years ago
parent d11abf1308
commit d756d27f4c

@ -105,6 +105,8 @@ nv.addGraph(function() {
.datum(testdata)
.transition().duration(500).call(chart);
nv.utils.windowResize(chart.update);
return chart;
});

@ -457,7 +457,7 @@ nv.models.axis = function() {
.attr('dy', '.71em')
.attr('y', axis.tickPadding())
.attr('transform', function(d,i,j) { return 'rotate(' + rotateLabels + ' 0,0)' })
.attr('text-anchor', rotateLabels%360 > 0 ? 'start' : 'end')
.attr('text-anchor', rotateLabels ? (rotateLabels%360 > 0 ? 'start' : 'end') : 'middle')
.text(function(d,i) {
var v = fmt(d);
return ('' + v).match('NaN') ? '' : v;

10
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -138,7 +138,7 @@ nv.models.axis = function() {
.attr('dy', '.71em')
.attr('y', axis.tickPadding())
.attr('transform', function(d,i,j) { return 'rotate(' + rotateLabels + ' 0,0)' })
.attr('text-anchor', rotateLabels%360 > 0 ? 'start' : 'end')
.attr('text-anchor', rotateLabels ? (rotateLabels%360 > 0 ? 'start' : 'end') : 'middle')
.text(function(d,i) {
var v = fmt(d);
return ('' + v).match('NaN') ? '' : v;

Loading…
Cancel
Save