使得轴刻度在nvd3中有更多的空间 [英] giving axis ticks more space in nvd3

查看:126
本文介绍了使得轴刻度在nvd3中有更多的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 nvd3 中构建一个横向条形图,其中域名为x标签。域名虽然不太长,但比给他们的空间长。如何在 nvd3




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.

解决方案

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.

这篇关于使得轴刻度在nvd3中有更多的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆