使用echart绘制拓扑图,树类型,自定义tooltip和label样式,可收缩

发布于:2024-03-19 ⋅ 阅读:(259) ⋅ 点赞:(0)
试读部分
效果如图: 鼠标移上显示 vue3 - ts文件 “echarts”: “^5.4.3”, import { EChartsOption } from 'echarts' import * as echarts from 'echarts/core' import { TooltipComponent } from 'echarts/components' import { TreeChart } from 'echarts/charts' import { CanvasRenderer } from 'echarts/renderers' echarts.use([TooltipComponent, TreeChart, CanvasRenderer]) export const treeOptions: EChartsOption = { tooltip: { trigger: 'item', triggerOn: 'mousemove', // 自定义数据 formatter: function (params) { const data = params.data const str = ` <div style="background:#FFF;display: flex;justify-content: space-between; gap:10px"> <div> <p>设备名称:</p> <p>设备编号:</p> <p>设备状态:</p> <p>最新读取时间:</p> <p>最新读数:</p> </div> ……
本文为 VIP 文章,已展示部分内容,开通 VIP 后查看全文

觉得这篇文章有帮助?

点个赞,或赞赏支持作者持续创作

微信公众号

今日签到

点亮在社区的每一天
去签到