Skip to content

Commit

Permalink
Merge pull request novus#1549 from robinv/fix-right-aligned-axis-labe…
Browse files Browse the repository at this point in the history
…l-distance

Added support for axisLabelDistance to right aligned axis
  • Loading branch information
liquidpele committed Apr 26, 2016
2 parents 4b1bae9 + 7080bce commit 4fd3e85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ nv.models.axis = function() {
axisLabel
.style('text-anchor', rotateYLabel ? 'middle' : 'begin')
.attr('transform', rotateYLabel ? 'rotate(90)' : '')
.attr('y', rotateYLabel ? (-Math.max(margin.right, width) + 12) : -10) //TODO: consider calculating this based on largest tick width... OR at least expose this on chart
.attr('y', rotateYLabel ? (-Math.max(margin.right, width) + 12 - (axisLabelDistance || 0)) : -10) //TODO: consider calculating this based on largest tick width... OR at least expose this on chart
.attr('x', rotateYLabel ? (d3.max(scale.range()) / 2) : axis.tickPadding());
if (showMaxMin) {
axisMaxMin = wrap.selectAll('g.nv-axisMaxMin')
Expand Down

0 comments on commit 4fd3e85

Please sign in to comment.