如下图,让x轴高亮显示,
方法一:设置x轴的axisLabel
xAxis: { axisLabel: { show: true, textStyle: { color: function (value, index) { return _this.axisValue !== "" && _this.axisValue === value ? "red" : "#666666"; }, }, interval: 0, }, }
复制
方法二:设置tooltip的axisPointer
tooltip: { trigger: 'axis', axisPointer: { label: { show: true, backgroundColor: '#fff', color: 'red', borderColor: 'rgba(0,0,0,0)', shadowColor: 'rgba(0,0,0,0)', shadowOffsetY: 0, }, lineStyle: { width: 0, }, }, }
复制