How to deal with overlapping X-axis labels in DOJO chart?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 07:38:17

问题


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?

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.


回答1:


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

e.g.

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



回答2:


The label shortening rules can be specified by parameters as follows: http://dojotoolkit.org/reference-guide/dojox/charting.html#axis-label-shortening



来源:https://stackoverflow.com/questions/6948229/how-to-deal-with-overlapping-x-axis-labels-in-dojo-chart

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