giving axis ticks more space in nvd3

 ̄綄美尐妖づ 提交于 2020-01-15 10:45:27

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!