关键代码如下:
xAxis: {
type: 'category',
name: 'Month',
nameLocation: 'end', //X轴标题位置(选项有:end,start,center)
nameTextStyle:{ //X轴标题
color:'yellow', //字体颜色
fontSize:14, //字体大小
padding:5 //padding用来调整位置
},
axisLabel: {
show: true,
textStyle: { color: 'white' } //X轴刻度字体颜色
},
data: []
},
yAxis: {
type: 'value',
name: 'Amount(¥)',
nameTextStyle:{ //Y轴标题
color:'orange', //Y轴标题字体颜色
fontSize:14,
padding:5
},
position: 'left',
axisLine: {
lineStyle: {
color: colors[0]
}
},
axisLabel: {
formatter: '{value} ',
textStyle: { color: 'white' } //Y轴刻度字体颜色
},
},
如图所示: