1、背景:在項目中常常會用到echarts的實例,根據不同的需求字體顏色需要變化,如圖,要切合背景,就需要更改字體顏色
2、解決方案
xAxis : [ { type : 'category', data : weekDay, axisLabel: { show: true, textStyle: { color: this.xFontColor //這里用參數代替了 } }, } ], yAxis : [ { type : 'value', splitLine:{ show:false }, // 去掉背景的網格線 axisLabel: { show: true, textStyle: { color:this.yFontColor //這里用參數代替了 } }, } ],