amCharts中的标签旋转不能正常工作

Label rotation in amCharts not working properly

本文关键字:常工作 工作 不能 标签 旋转 amCharts      更新时间:2023-09-26

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

我添加了chart.labelRotation =45

小提琴

它不工作!

labelRotationcategoryAxis的属性,而不是chart的属性。因此,您需要将其应用于chart.categoryAxis:

chart.categoryAxis.labelRotation = 45;

使用AmCharts。makeChart:

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