如何设置X轴标签的宽度? [英] How to set width to x-axis label?

查看:659
本文介绍了如何设置X轴标签的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果x轴标签很长,则它在下一个标签上会重叠.像这样.如何设置宽度,使其显示在下面的快照中?

If the x-axis label is long, it is getting overlapper on the next label like this. How do I set a width to it so that it appears as in the snapshot below?

x轴代码:

var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.tickSize(10,10);

jsFiddle

推荐答案

我无法准确执行图像中存在的内容.

I couldn't do the exact thing what's there in the image.

但是我发现来自 this 链接 .

But i found this from this link.

使用自定义功能包装x轴标签.

Wrapping the x axis labels using a custom function.

希望这会有所帮助. :)

Hope this helps. :)

这篇关于如何设置X轴标签的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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