Echarts 实现自定义图片关系图

本文介绍如何使用百度ECharts库创建包含图片头像的关系图,通过自定义节点图标为关系图增加个性化元素,展示了从数据准备到图表展示的全过程。

百度echart 实现带图片头像的关系图

<!DOCTYPE html>
<html style="height: 100%">
 
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta charset="utf-8">
    <style type="text/css">
       
    </style>
</head>
 
<body style="height: 100%; margin: 0">
    <div id="container" style="width:600px; height:500px; overflow:hidden;border: 1px solid red;"></div>


    <script type="text/javascript" src="echarts.min.js"></script>
    <script type="text/javascript">
 
        var myChart = echarts.init(document.getElementById("container")); 
        var echartJson ={
            "series":[
                {
                    "edgeLabel":{
                        "normal":{
                            "formatter":"{c}",
                            //"show":true,//是否显示枝干上的关系文字
                        }
                    },
                    //"edgeSymbol":"arrow",//circle,arrow//线两边显示箭头或圆
                    "force":{
                        "repulsion":200,//枝干线的长短 
                        'edgeLength':40
                    },
                    "layout":"force",
                    
                    "roam":true,
                    "itemStyle":{
                        "normal":{
                            "color":"#00ff00"//文字颜色
                        }
                    },
                    "label":{
                        "normal":{
                            //"show":true,//是否显示文字
                        }
                    },
                    "symbol":"circle",
                    "symbolSize":1,
                    "type":"graph",
                    'lineStyle': {//线的样式
                        'normal': {
                            'opacity': 1,
                            // width: 5,
                            curveness: 0,
   &n
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值