首页 前端知识 echarts的x轴选中的时候高亮

echarts的x轴选中的时候高亮

2024-03-12 01:03:18 前端知识 前端哥 859 263 我要收藏

如下图,让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,
},
},
}
复制

转载请注明出处或者链接地址:https://www.qianduange.cn//article/3684.html
标签
评论
发布的文章

jquery监听input值改变

2024-04-08 11:04:31

jquery 笔记

2024-04-08 11:04:27

jQuery Ajax前后端数据交互

2024-04-08 11:04:24

JQuery入门基础

2024-02-20 10:02:06

JQuery中的事件对象

2024-04-08 11:04:16

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!