配置:
xAxis: [
{
type: 'category',
name: '月份',
axisTick: {
alignWithLabel: true
},
data: [{
value: '1月',
textStyle: {
fontSize: 20,
color:'red'
}
},'2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
splitLine: {
lineStyle: {
color: 'red'
}
}
},
],

使用 \n
进行换行
xAxis: [
{
type: 'category',
// position: 'top',
name: '\n\n月份', // 换行
// name: '月份',
// maxInterval: 2,
axisTick: {
alignWithLabel: true
},
data: [{
value: '1月',
textStyle: {
fontSize: 20,
color:'red'
}
},'2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
splitLine: {
lineStyle: {
color: 'red'
}
}
},
],

网友评论