美文网首页
echarts3绘制拓扑图

echarts3绘制拓扑图

作者: web_柚子小记 | 来源:发表于2019-04-01 14:13 被阅读0次
效果图: image.png

配置:

var option = {
            title: {
                text: '人物关系拓扑图',
                show: true,
                textStyle: {
                    color: '#fff',
                    fontWeight: 'normal'
                },
                padding: [10, 0, 10, -90],
                left: '50%'
            },
            tooltip: {},
            animationDuration: 1,
            animationDurationUpdate: 1500,
            animationEasingUpdate: 'quinticInOut',
            label: {
                normal: {
                    show: true,
                    textStyle: {
                        fontSize: 12
                    },
                }
            },
            legend: {
                x: "center",
                show: false,
                data: ["事件", "人物"]
            },
            series: [
                {
                    type: 'graph',
                    layout: 'force',
                    force: {
                        repulsion: 1000,
                        gravity: 0.01
                    },
                    symbolSize: 45,
                    focusNodeAdjacency: true,
                    roam: 'scale',
                    categories: [{
                        name: '事件',
                        itemStyle: {
                            normal: {
                                color: "#fff",
                            }
                        }
                    }, {
                        name: '人物',
                        itemStyle: {
                            normal: {
                                color: "#fff",
                            }
                        }
                    }],
                    label: {
                        normal: {
                            show: true,
                            textStyle: {
                                fontSize: 12,
                                color: '#333'
                            }
                        }
                    },
                    nodes: [{
                        name: '事件1',
                        id: '10000',
                        category: 0,
                        x: point1.x,
                        y: point1.y,
                        fixed: true,
                        symbolSize: 60
                    }, {
                        name: '付世文',
                        id: '10001',
                        category: 1
                    }, {
                        name: '邓志荣',
                        id: '10002',
                        category: 1
                    }, {
                        name: '李荣庆',
                        id: '10003',
                        category: 1
                    }, {
                        name: '郑志勇',
                        id: '10004',
                        category: 1
                    }, {
                        name: '事件2',
                        id: '20000',
                        category: 0,
                        x: point2.x,
                        y: point2.y,
                        fixed: true,
                        symbolSize: 60
                    }, {
                        name: '赵英杰',
                        id: '20001',
                        category: 1
                    }, {
                        name: '王承军',
                        id: '20002',
                        category: 1
                    }, {
                        name: '陈卫东',
                        id: '20003',
                        category: 1
                    }, {
                        name: '邹劲松',
                        id: '20004',
                        category: 1
                    }, {
                        name: '事件3',
                        id: '30000',
                        category: 0,
                        x: point3.x,
                        y: point3.y,
                        fixed: true,
                        symbolSize: 60
                    }, {
                        name: '赵成',
                        id: '30001',
                        category: 1
                    }, {
                        name: '陈现忠',
                        id: '30002',
                        category: 1
                    }, {
                        name: '陶泳',
                        id: '30003',
                        category: 1
                    }, {
                        name: '王德福',
                        id: '30004',
                        category: 1
                    }],
                    links: [{
                        source: '10000',
                        target: '10001',
                        lineStyle: {
                            normal: {
                                color: 'rgb(225,84,78)'
                            }
                        }
                    }, {
                        source: '10000',
                        target: '10002',
                        lineStyle: {
                            normal: {
                                color: 'rgb(225,84,78)'
                            }
                        }
                    }, {
                        source: '10000',
                        target: '10003',
                        lineStyle: {
                            normal: {
                                color: 'rgb(225,84,78)'
                            }
                        }
                    }, {
                        source: '10000',
                        target: '10004',
                        lineStyle: {
                            normal: {
                                color: 'rgb(225,84,78)'
                            }
                        }
                    }, {
                        source: '20000',
                        target: '20001',
                        lineStyle: {
                            normal: {
                                color: 'rgb(253,177,56)'
                            }
                        }
                    }, {
                        source: '20000',
                        target: '20002',
                        lineStyle: {
                            normal: {
                                color: 'rgb(253,177,56)'
                            }
                        }
                    }, {
                        source: '20000',
                        target: '20003',
                        lineStyle: {
                            normal: {
                                color: 'rgb(253,177,56)'
                            }
                        }
                    }, {
                        source: '20000',
                        target: '20004',
                        lineStyle: {
                            normal: {
                                color: 'rgb(253,177,56)'
                            }
                        }
                    }, {
                        source: '30000',
                        target: '30001',
                        lineStyle: {
                            normal: {
                                color: 'rgb(110,197,75)'
                            }
                        }
                    }, {
                        source: '30000',
                        target: '30002',
                        lineStyle: {
                            normal: {
                                color: 'rgb(110,197,75)'
                            }
                        }
                    }, {
                        source: '30000',
                        target: '30003',
                        lineStyle: {
                            normal: {
                                color: 'rgb(110,197,75)'
                            }
                        }
                    }, {
                        source: '30000',
                        target: '30004',
                        lineStyle: {
                            normal: {
                                color: 'rgb(110,197,75)'
                            }
                        }
                    }, {
                        source: '20001',
                        target: '30002',
                        lineStyle: {
                            normal: {
                                type: 'curve',
                                color: 'rgb(1,252,247)',
                                curveness: 0.5
                            }
                        }
                    }, {
                        source: '30003',
                        target: '20001',
                        lineStyle: {
                            normal: {
                                type: 'curve',
                                color: 'rgb(1,252,247)',
                                curveness: 0.5
                            }
                        }
                    }, {
                        source: '20004',
                        target: '10004',
                        lineStyle: {
                            normal: {
                                type: 'curve',
                                color: 'rgb(1,252,247)',
                                curveness: 0.5
                            }
                        }
                    }, {
                        source: '30003',
                        target: '10003',
                        lineStyle: {
                            normal: {
                                type: 'curve',
                                color: 'rgb(1,252,247)',
                                curveness: 0.5
                            }
                        }
                    }, {
                        source: '10002',
                        target: '30002',
                        lineStyle: {
                            normal: {
                                type: 'curve',
                                color: 'rgb(1,252,247)',
                                curveness: 0.5
                            }
                        }
                    }, {
                        source: '20004',
                        target: '30001',
                        lineStyle: {
                            normal: {
                                type: 'curve',
                                color: 'rgb(1,252,247)',
                                curveness: 0.5
                            }
                        }
                    }, {
                        source: '30000',
                        target: '10000',
                        lineStyle: {
                            normal: {
                                type: 'curve',
                                color: 'rgb(1,252,247)',
                                curveness: 0.5
                            }
                        }
                    }],
                    lineStyle: {
                        normal: {
                            type: 'solid',
                            opacity: 1,
                            width: 2,
                            curveness: 0
                        }
                    }
                }
            ]
        };

传送门:
https://github.com/Youzi-wr/echarts-topology/tree/master

相关文章

  • echarts3绘制拓扑图

    配置: 传送门:https://github.com/Youzi-wr/echarts-topology/tree...

  • Echarts关系图demo

    以上市公司的调研数据为例,对echarts的关系图绘制和各属性进行解释;echarts3没有force了,而是把f...

  • 2018-09-20

    分工 (1)讨论系统功能(2)搜集文字素材:马才楷(3)绘制功能模块图:蒋婷(4)绘制网络拓扑图:文伟(5)设计界...

  • THREE.JS 绘制飞线 攻击线 迁移线 拓扑图动画线条等

    THREE.JS 绘制飞线 攻击线 迁移线 拓扑图动画线条等 在THREE中如何绘制飞线;使用的是Points+S...

  • echarts3 在一个canvas中同时绘制折线图和柱状图

    echarts3 在一个canvas中同时绘制折线图和柱状图 series 是一个数组,可以同时包含各种图型的数据...

  • 告诉你漂亮标准的网络拓扑图是怎么画出来的?

    绘制网络拓扑图是网络工程中必不可少的步骤,对于网络工程师到底怎么把拓扑图画好还真的是个技术活,但是熟能生巧小编就给...

  • 2018-09-20

    商超收银系统 小组分工搜集文字素材——杨鑫绘制功能模块图——张继文绘制网络拓扑图——朱向前界面设计——倪婉钰文档撰...

  • 2018-10-14

    队长:曾维月(设计界面,绘制网络拓扑图) 组员: 郭录政 (文档撰写) 郑家圆 (搜集文字素材) 王丽 ...

  • 智慧社区商超管理系统

    团队介绍 队长:曾维月(设计界面,绘制网络拓扑图) 组员: 郭录政 (文档撰写) 郑家圆 (搜集文字素材)...

  • Echarts-百度地图省分着色

    通过Echarts3结合百度地图,对全国省分进行着色。 起因 由于Echarts3中,不再使用china.js文件...

网友评论

      本文标题:echarts3绘制拓扑图

      本文链接:https://www.haomeiwen.com/subject/pmtvbqtx.html