1. xAxis.axisLabel property
By making the x-axis text slanted
axisLabel: {
interval:0,
rotate:40
}
//控制x轴
xAxis: [
{
type: 'category',
//字体倾斜
axisLabel: {
interval:0,
rotate:40
},
data: deptList
}
]
When the text is too long, it can be displayed by adjusting the grid
grid: {
y: 80,
y2:140,
x2: 140
}
2. Call the formatter to display the text vertically
axisLabel: {
interval: 0,
formatter: function (value) {
return value.split("").join("\n");
}
}