echarts设置tooltip的层级
echarts设置tooltip的层级
tooltip: { trigger: "axis", extraCssText: 'z-index:3', // 修改层级 borderColor: "rgba(0, 170, 255)", },
完整的option示例如下:
option = { tooltip: { trigger: "axis", extraCssText: 'z-index:3', axisPointer: { // 方法一 type: "shadow", // 默认为直线,可选为:'line' | 'shadow' shadowStyle: { color: "rgba(41, 95, 204, 0.2)", }, }, borderColor: "rgba(0, 170, 255)", // 边框颜色 formatter: function (params) { return [ "时间:" + params[0].name + ":00", "拥堵指数:" + params[0].value, ].join("<br/>"); }, }, // 坐标轴指示器配置 textStyle: { color: "#333", // xy轴的提示文字颜色,不包含背景刻度线 }, color: ["#1492FF"], grid: { top: "20px", left: "50px", right: "20px", bottom: "25px", }, xAxis: [ { type: "category", data: this.chartsData.time, axisLine: { show: true, lineStyle: { color: "#004080", // width: 0, // type: "solid", }, // x轴线的颜色以及宽度 }, // axisLabel: { // show: true, // textStyle: { // color: "rgba(255, 255, 255, 0.3)", // } // }, // x轴文字的配置 splitLine: { show: false, lineStyle: {}, // 分割线配置 }, axisTick: { show: false, }, // x轴的刻度线 }, ], yAxis: [ { type: "value", max: 10, splitLine: { show: true, lineStyle: { color: "#333", opacity: 0.1, }, // 设置横向的线的颜色 }, axisLabel: { show: true, margin: 20, // textStyle: { // color: "rgba(255, 255, 255, 0.3)", // }, // y轴的字体配置 }, splitArea: { show: true, areaStyle: { color: [ "rgb(0, 128, 0, .2)", "rgb(153, 204, 0, .2)", "rgb(255, 255, 0, .2)", "rgb(255, 153, 0, .2)", "rgb(255, 0, 0, .2)", ], }, }, }, ], series: [ { data: this.chartsData.roadNorm, type: "line", smooth: true, symbolSize: 0, // 设置圆点大小为 0,即不显示圆点 }, ], };
本文来自博客园,作者:毛三仙,转载请注明原文链接:https://www.cnblogs.com/ProgrammerMao-001/p/18342757
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具