amCharts 中的标签旋转无法正常工作

Label rotation in amCharts not working properly

我需要将 x 轴标签旋转 45 度。我所做的如下:

我已经添加了chart.labelRotation =45

fiddle

它不起作用!

labelRotationcategoryAxis 的 属性,而不是图表的 属性。所以你需要将它应用到 chart.categoryAxis:

chart.categoryAxis.labelRotation = 45;

这是你的updated fiddle

使用AmCharts.makeChart:

var chart = AmCharts.makeChart( chartId, {
....
....
"categoryAxis": {
   "labelRotation": 45,
....
},
....
....
}