echarts图表鼠标悬浮显示数据

·  阅读 4933
在 option 配置里添加 tooltip ``` js option = { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [{ data: [120, 200, 150, 80, 70, 110, 130], type: 'bar' }], tooltip: { // 鼠标悬浮提示框显示 X和Y 轴数据 trigger: 'axis', backgroundColor: 'rgba(32, 33, 36,.7)', borderColor: 'rgba(32, 33, 36,0.20)', borderWidth: 1, textStyle: { // 文字提示样式 color: '#fff', fontSize: '12' }, axisPointer: { // 坐标轴虚线 type: 'cross', label: { backgroundColor: '#6a7985' } }, } }; ```
分类:
前端
文章转载地址:
echarts图表鼠标悬浮显示数据
https://inx.fun/article/1194069
评论
支持匿名评论 · Ctrl/⌘ + Enter 发送