IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> JavaScript知识库 -> Echarts关系图 -> 正文阅读

[JavaScript知识库]Echarts关系图

效果图

?代码:

<template>
  <div>
     <div id="echart" style="width:100%;height:600px;"></div>
  </div>
</template>
<script>
import * as echarts from 'echarts';
export default {
  data () {
    return {
    }
  },
  mounted () {
    this.echartlist()
  },
  methods: {
    echartlist() {
      var option =  {
            title: { text: '家族树' },
            tooltip: {
                formatter: function (x) {
                    return x.data.des;
                }
            },
            series: [
                {
                    type: 'graph',
                    layout: 'force',
                    symbolSize: 30,
                    roam: true,
                    edgeSymbol: ['circle', 'arrow'],
                    edgeSymbolSize: [1, 10],
                    edgeLabel: {
                        normal: {
                            textStyle: {
                                fontSize: 20
                            }
                        }
                    },
                    force: {
                        repulsion: 1000,
                        edgeLength: [10, 40],
                        layoutAnimation: false
                    },
                    draggable: true,
                    itemStyle: {
                        normal: {
                            color: '#4b565b'
                        }
                    },
                    lineStyle: {
                        normal: {
                            width: 2,
                            color: '#4b565b'

                        }
                    },
                    edgeLabel: {
                        normal: {
                            show: true,
                            formatter: function (x) {
                                return x.data.name;
                            }
                        }
                    },
                    label: {
                        normal: {
                            show: true,
                            textStyle: {
                            }
                        }
                    },
                    data: [
                      {
                          name: '华为技术有限公司',
                          // des: '华为技术有限公司',
                          symbolSize: 90,
                          itemStyle: {
                              normal: {
                                  color: '#F81D22'
                              }
                          }
                      },
                      { name: '华为投资控股有限公司', symbolSize: 60 },
                      { name: '杭州华为企业通信技术有限公司' },
                      { name: '上海海思技术有限公司' },
                      { name: '华为软件技术有限公司' },
                      { name: '深圳市海思半导体有限公司' },
                      { name: '海思光电子有限公司' },
                      { name: '杭州华为数字技术有限公司' },
                      { name: '深圳市华为技术服务有限公司' },
                      { name: '华为技术服务有限公司' },
                      { name: '成都华为技术有限公司' },
                      { name: '浙江华为通信技术有限公司' },
                      { name: '北京华为数字技术有限公司' },
                      { name: '上海华为技术有限公司' },
                      { name: '西安华为技术有限公司' },
                      { name: '华为机器有限公司' },
                      { name: '华为机器有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '华为机器有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '杭州华为企业通信技术有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '杭州华为企业通信技术有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '上海海思技术有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '上海海思技术有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '华为软件技术有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '华为软件技术有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '深圳市海思半导体有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '深圳市海思半导体有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '海思光电子有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '海思光电子有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '杭州华为数字技术有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '杭州华为数字技术有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '深圳市华为技术服务有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '深圳市华为技术服务有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '华为技术服务有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '华为技术服务有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '成都华为技术有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '成都华为技术有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '浙江华为通信技术有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '浙江华为通信技术有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                      { name: '北京华为数字技术有限公司2', itemStyle: { normal: { color: '#C79AF1' } } },
                      { name: '北京华为数字技术有限公司3', itemStyle: { normal: { color: '#2B7FF1' } } },
                    ],
                    links: [
                      { source: '华为投资控股有限公司', target: '华为技术有限公司', name: '子公司', des: '华为投资控股有限公司是华为技术有限公司的父公司' },
                      { source: '华为技术有限公司', target: '杭州华为企业通信技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '上海海思技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '华为软件技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '深圳市海思半导体有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '海思光电子有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '杭州华为数字技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '深圳市华为技术服务有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '华为技术服务有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '成都华为技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '浙江华为通信技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '北京华为数字技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '上海华为技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '西安华为技术有限公司', name: '子公司' },
                      { source: '华为技术有限公司', target: '华为机器有限公司', name: '子公司' },
                      { source: '华为机器有限公司', target: '华为机器有限公司2', name: '子公司' },
                      { source: '华为机器有限公司2', target: '华为机器有限公司3', name: '子公司' },
                      { source: '杭州华为企业通信技术有限公司', target: '杭州华为企业通信技术有限公司2', name: '子公司' },
                      { source: '杭州华为企业通信技术有限公司2', target: '杭州华为企业通信技术有限公司3', name: '子公司' },
                      { source: '上海海思技术有限公司', target: '上海海思技术有限公司2', name: '子公司' },
                      { source: '上海海思技术有限公司2', target: '上海海思技术有限公司3', name: '子公司' },
                      { source: '华为软件技术有限公司', target: '华为软件技术有限公司2', name: '子公司' },
                      { source: '华为软件技术有限公司2', target: '华为软件技术有限公司3', name: '子公司' },
                      { source: '深圳市海思半导体有限公司', target: '深圳市海思半导体有限公司2', name: '子公司' },
                      { source: '深圳市海思半导体有限公司2', target: '深圳市海思半导体有限公司3', name: '子公司' },
                      { source: '海思光电子有限公司', target: '海思光电子有限公司2', name: '子公司' },
                      { source: '海思光电子有限公司2', target: '海思光电子有限公司3', name: '子公司' },
                      { source: '杭州华为数字技术有限公司', target: '杭州华为数字技术有限公司2', name: '子公司' },
                      { source: '杭州华为数字技术有限公司2', target: '杭州华为数字技术有限公司3', name: '子公司' },
                      { source: '深圳市华为技术服务有限公司', target: '深圳市华为技术服务有限公司2', name: '子公司' },
                      { source: '深圳市华为技术服务有限公司2', target: '深圳市华为技术服务有限公司3', name: '子公司' },
                      { source: '华为技术服务有限公司', target: '华为技术服务有限公司2', name: '子公司' },
                      { source: '华为技术服务有限公司2', target: '华为技术服务有限公司3', name: '子公司' },
                      { source: '成都华为技术有限公司', target: '成都华为技术有限公司2', name: '子公司' },
                      { source: '成都华为技术有限公司2', target: '成都华为技术有限公司3', name: '子公司' },
                      { source: '浙江华为通信技术有限公司', target: '浙江华为通信技术有限公司2', name: '子公司' },
                      { source: '浙江华为通信技术有限公司2', target: '浙江华为通信技术有限公司3', name: '子公司' },
                      { source: '北京华为数字技术有限公司', target: '北京华为数字技术有限公司2', name: '子公司' },
                      { source: '北京华为数字技术有限公司2', target: '北京华为数字技术有限公司3', name: '子公司' },
                    ]
                }
            ]
        }
      var dom = document.getElementById('echart')
      var myChart = echarts.init(dom)
      myChart.setOption(option)
    }
  }
}
</script>

  JavaScript知识库 最新文章
ES6的相关知识点
react 函数式组件 & react其他一些总结
Vue基础超详细
前端JS也可以连点成线(Vue中运用 AntVG6)
Vue事件处理的基本使用
Vue后台项目的记录 (一)
前后端分离vue跨域,devServer配置proxy代理
TypeScript
初识vuex
vue项目安装包指令收集
上一篇文章      下一篇文章      查看所有文章
加:2021-07-24 00:05:00  更:2021-07-24 00:05:11 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/6 14:00:04-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码