关键点:
yAxis.axisLabel.textStyle.color、xAxis.axisLabel.textStyle.color
具体实现
yAxis: [
{
type: "category",
show: true,
inverse: false,
data: ["80%以上", "50%-80%", "50%以下"],
axisLine: {//刻度线显隐
show: false,
},
axisTick: {//刻度
show: false,
},
axisLabel: {
// 坐标轴刻度标签的相关设置
show: true,
margin: 15,
textStyle: {
fontSize: 16,
color: function (value) {
return value == "80%以上"
? "#81D3F8"
: value == "50%-80%"
? "#FF6600"
: "#FF004D";
},
},
interval: 0,
},
inverse: true,
},
],