如何在DOJO图表中处理重叠的X轴标签?

问题描述:

我最近开始使用dojo库,而且目前我的x轴标签有一些格式化问题。一些标签有更长的名称,因此有一些重叠。有一些方法可以让标签自动进行自己的放置,或者长时间的标签出现在其他标签之下,以便它们与其他标签不重叠。

I have recently starting using the dojo library, and I am currently having some formatting problems with my x-axis labels. A few of the labels have longer names, and thus there is some overlap going on. Is there some way to have the labels automatically space themselves, or for longer labels to appear below the others so that they do not overlap the other labels?

我已经尝试使用旋转属性,bu我不满意的结果。虽然它确实防止了重叠,但它也大大减少了实际图表占用的面积。

I have tried using the rotation property, bu I was not satisfied with the result. While it did prevent overlapping, it also significantly reduced the area taken up by the actual chart.

您还可以旋转标签但是使用旋转属性。

You can also rotate the labels but using the "rotation" attribute.

例如

YourChartDefinition.addAxis("x", 
                            {vertical   : false,
                             minorTicks : true,
                             includeZero: false,
                             font: "normal normal bold 8pt Arial",
                             rotation: -30,
                             labels: labels_for_axis
                            }      
                           );