问题
I am constructing a horizontal bar plot in nvd3
with domain names as x-labels. The domain names, while not too long, are longer than the amount of space given to them. How do I increase the amount of space given to an axis in nvd3
?
jsfiddle example here.
回答1:
Apparently, you can specify your own margins. For example:
var chart = nv.models.multiBarHorizontalChart()
.margin({top: 30, right: 10, bottom: 30, left: 90}) // increase the left margin
.x(function(d) { return d[0]; })
.y(function(d) { return d[1]; });
Here is the updated fidle.
来源:https://stackoverflow.com/questions/18926328/giving-axis-ticks-more-space-in-nvd3