vue3_echarts自定义graph关系图

简介: vue3_echarts自定义graph关系图

参考

ecahrts官方文档

自定义测试

探索:关系图的关键

  • 起点
  • 终点
  • 线条

其次

  • 标签文字
  • 线条标签

image.png

配置关键:

 {
        title: {
          text: "2021->2022 我的职业",
          color: "#fff",
          x: "left",
          width: 120,
          height: 80,
          backgroundColor: "#6dd5ed",
          borderColor: "#fff",
          borderWidth: 1,
          padding: 5,
          textStyle: {
            fontFamily: "Arial",
            fontSize: 20,
            fontStyle: "normal",
            fontWeight: "bold",
            color: "#fff",
          },
        },
        tooltip: {},
        animationDurationUpdate: 1500,
        animationEasingUpdate: "quinticInOut",
        series: [
          {
            type: "graph",
            layout: "none",
            symbolSize: 0,
            roam: true,
            edgeSymbol: ["circle", "arrow"],
            edgeSymbolSize: [4, 10],
            edgeLabel: {
              fontSize: 15,
            },
            label: {
              //
              show: true,
              formatter: function (params) {
                console.log(params, params);
                return params.name;
              },
              width: 80,
              fontSize: 16,
              height: 40,
              color: "#fff",
              backgroundColor: "#6dd5ed",
              borderColor: "#fff",
              borderWidth: 1,
            },
            data: [
              {
                name: "2021",
                x: 100,
                y: 50,
              },
              {
                name: "2022",
                x: 800,
                y: 50,
              },
              {
                name: "数据分析",
                x: 100,
                y: 275,
              },
              {
                name: "sql语言",
                x: 450,
                y: 450,
              },
              {
                name: "javascript",
                x: 450,
                y: 100,
              },
              {
                name: "前端vue",
                x: 800,
                y: 275,
              },
            ],
            // links: [],
            links: [
              {
                source: 0,
                target: 1,
                symbolSize: [10, 20],
                label: {
                  show: true,
                  fontWeight: "bold",
                  color: "#fff",
                  formatter: function () {
                    // console.log(params, params);
                    return "数据分析->前端";
                  },
                },
                lineStyle: {
                  width: 1,
                  color: "#6dd5ed",
                  curveness: 0,
                },
              },
              {
                source: 2,
                target: 3,
                label: {
                  show: true,
                  color: "#fff",
                  formatter: function () {
                    return "mysql pgsql greemplum";
                  },
                },
                lineStyle: {
                  color: "#6dd5ed",
                  curveness: 0,
                },
              },
              {
                source: 2,
                target: 4,
                label: {
                  show: true,
                  color: "#fff",
                  formatter: function () {
                    return "es6";
                  },
                },
                lineStyle: {
                  color: "#6dd5ed",
                  curveness: 0,
                },
              },
              {
                source: 3,
                target: 5,
                label: {
                  show: true,
                  formatter: function () {
                    return "";
                  },
                },
                lineStyle: {
                  color: " #6dd5ed",
                },
              },
              {
                source: 4,
                target: 5,
                label: {
                  show: true,
                  color: "#fff",
                  formatter: function () {
                    return "es6->es12";
                  },
                },
                lineStyle: {
                  color: " #6dd5ed",
                },
              },
            ],
            lineStyle: {
              opacity: 0.9,
              width: 2,
              curveness: 0,
            },
          },
        ],
      }

仓库

https://github.com/yongma16/emoji-search

浏览

http://yongma16.xyz/emoji/index/
image.png

目录
相关文章
|
数据可视化 索引
数据可视化之antv/g6 元素之边(edge)
数据可视化之antv/g6 元素之边(edge)
2303 0
Element ui dialog弹窗最大化最小化关闭组件封装
封装一个最大化最小化关闭的dialog弹窗组件
3154 1
|
JavaScript
echarts_自定义graph关系图
echarts_自定义graph关系图
880 0
|
7月前
|
JSON 算法 安全
harmony-utils之SM4,SM4加解密
harmony-utils是一款专为HarmonyOS开发的高效工具库,提供丰富的实用功能,如SM4加解密、设备操作、文件处理等,助力开发者快速构建鸿蒙应用。
427 0
|
测试技术 数据安全/隐私保护 索引
基于 SpringBoot+Vue+MySql+Java 的大学生体质测试管理系统,附源码(二)
基于 SpringBoot+Vue+MySql+Java 的大学生体质测试管理系统,附源码
|
Prometheus 监控 Cloud Native
使用mysqld_exporter监控所有MySQL实例
使用mysqld_exporter监控所有MySQL实例
1499 2
|
Cloud Native 安全 Devops
核心系统转型问题之数字化韧性的定义如何解决
核心系统转型问题之数字化韧性的定义如何解决
|
数据库
element多选框select下拉框数据回显的问题value.push is not a function
element多选框select下拉框数据回显的问题value.push is not a function
1524 1
|
资源调度 JavaScript Windows
'vue-cli-service' 不是内部或外部命令,也不是可运行的程序问题解决
【5月更文挑战第7天】'vue-cli-service' 不是内部或外部命令,也不是可运行的程序问题解决
20567 3
|
前端开发 JavaScript API
js【详解】ajax (含XMLHttpRequest、 同源策略、跨域、JSONP)
js【详解】ajax (含XMLHttpRequest、 同源策略、跨域、JSONP)
313 0

热门文章

最新文章