{"action":"created","issue":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/4062","repository_url":"https://api.github.com/repos/ecomfe/echarts","labels_url":"https://api.github.com/repos/ecomfe/echarts/issues/4062/labels{/name}","comments_url":"https://api.github.com/repos/ecomfe/echarts/issues/4062/comments","events_url":"https://api.github.com/repos/ecomfe/echarts/issues/4062/events","html_url":"https://github.com/ecomfe/echarts/issues/4062","id":176252377,"number":4062,"title":"当series 的type是graph时，使用edgeLabel自定义的formatter不起作用，只能通过在links里边每个连线的label属性单独设置","user":{"login":"wade0817wang","id":19803149,"avatar_url":"https://avatars.githubusercontent.com/u/19803149?v=3","gravatar_id":"","url":"https://api.github.com/users/wade0817wang","html_url":"https://github.com/wade0817wang","followers_url":"https://api.github.com/users/wade0817wang/followers","following_url":"https://api.github.com/users/wade0817wang/following{/other_user}","gists_url":"https://api.github.com/users/wade0817wang/gists{/gist_id}","starred_url":"https://api.github.com/users/wade0817wang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wade0817wang/subscriptions","organizations_url":"https://api.github.com/users/wade0817wang/orgs","repos_url":"https://api.github.com/users/wade0817wang/repos","events_url":"https://api.github.com/users/wade0817wang/events{/privacy}","received_events_url":"https://api.github.com/users/wade0817wang/received_events","type":"User","site_admin":false},"labels":[{"id":370414861,"url":"https://api.github.com/repos/ecomfe/echarts/labels/PENDING","name":"PENDING","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-11T16:39:38Z","updated_at":"2016-12-06T02:47:30Z","closed_at":null,"body":"<!--\n为了方便我们能够复现和修复 bug，请遵从下面的规范描述您的问题。\n-->\n#### 问题简述 (One-line summary)\n\n当series 的type是graph时，使用edgeLabel自定义的formatter不起作用，只能通过在links里边每个连线的label属性单独设置\n#### 版本及环境 (Version & Environment)\n- ECharts 版本 (ECharts version): 3.2.3\n- 浏览器类型和版本 (Browser version): chrome\n- 操作系统类型和版本 (OS Version):win7\n#### 重现步骤 (Steps to reproduce)\n\n1.写代码实现一个graph图\n2.通过series里边的edgeLabel自定义连线上显示的文字\n#### 期望结果 (Expected behaviour)\n\n期望连线上变显示自定义格式的文字\n#### 可能哪里有问题 (What went wrong)\n\n可能echarts库里边没有读取series->edgeLabel->normal->formatter属性\n#### ECharts配置项 (ECharts option)\n\n<!-- 下方贴你的option，注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。\n最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing\n-->\n\n``` javascript\noption = {\n                backgroundColor: '#404a59',\n                animation: true,\n                animationDuration: 1000,\n                animationEasing: 'cubicInOut',\n                animationDurationUpdate: 1000,\n                animationEasingUpdate: 'cubicInOut',\n                legend: {\n                    right: 10,\n                    selectedMode: 'single',\n                    data: ['慢速率', '命中率']\n                },\n                tooltip: {\n                    trigger: 'item',\n                    hideDelay: 3000,\n                    enterable: true,\n                    //position: 'bottom',\n                    //alwaysShowContent: true,\n                    show: true,\n                    formatter: function(params){\n                        console.log(params); \n                        return params.name;\n                    }\n                },\n                title: {\n                    text: '例子',\n                    shadowBlur: 10\n                },\n                visualMap:[{        //根据不同维度的数据，产生不同的视觉效果\n                    type: 'continuous',\n                    min: 0,\n                    max: 100,\n                    range:[0,100],\n                    calculable: true,\n                    realtime: true,\n                    text:['最大值','最小值'],\n                    inRange:{\n                        symbolSize:[20,80]\n                    },\n                    dimension: 0,\n                    seriesIndex: 0,\n                    show: true\n                }],\n                series: [{\n                    name: '慢速率',\n                    type: 'graph',\n                    legendHoverLink: true,\n                    hoverAnimation: true,\n                    layout:'none',\n                    roam: true, //是否开始鼠标缩放\n                    nodeScaleRatio:  0, //节点缩放\n                    focusNodeAdjacency: true,   //是否在鼠标移动到节点上的时候显示界定啊以及节点的边和邻接节点\n                    symbol: 'circle',   //节点显示图形，可自定义设置图\n                    symbolSize: 50, //节点图标大小\n                    itemStyle: {\n                        normal: {\n                            shadowBlur: 10,\n                            shadowColor: 'rgba(120, 36, 50, 0.5)',\n                            shadowOffsetY: 5,\n                            color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{\n                                offset: 0,\n                                color: 'rgb(251, 118, 123)'\n                            }, {\n                                offset: 1,\n                                color: 'rgb(204, 46, 72)'\n                            }])\n                        }\n                    },\n                    symbolOffset: [0,0],    //图标偏移\n                    edgeSymbol: ['none', 'arrow'],  //边两端的标记类型\n                    edgeSymbolSize: 20, //边两端的标记大小\n                    label: {\n                        normal: {\n                            show: true,\n                            formatter: function(params){\n                                return '节点名称：'+params.name + '\\n' + \n                                       '慢速率：' + (params.value)[1] + '\\n' +\n                                       '带宽：' + (params.value)[0];\n                            },\n                            position:'insideLeft'\n                        }\n                    },\n                    edgeLabel: {\n                        normal: {\n                            show: true,\n                            formatter: function(params){\n                                return '线路：'+params.name + '\\n' + \n                                       'RTT：' + (params.value)[5] + '\\n' +\n                                       '丢包率：' + (params.value)[4] + '\\n' +\n                                       '带宽：' + (params.value)[0];\n                            },\n                            position:'middle'\n                        }\n                    },\n                    data: dataObj.data,\n                    links: dataObj.links\n                }]\n}\n\n```\n#### 其他信息 (Other comments)\n\n<!-- 例如，截图或线上实例 (JSFiddle/JSBin/Codepen) (For example: Screenshot or Online demo) -->\n"},"comment":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/comments/265045529","html_url":"https://github.com/ecomfe/echarts/issues/4062#issuecomment-265045529","issue_url":"https://api.github.com/repos/ecomfe/echarts/issues/4062","id":265045529,"user":{"login":"hongxingwz","id":20805867,"avatar_url":"https://avatars.githubusercontent.com/u/20805867?v=3","gravatar_id":"","url":"https://api.github.com/users/hongxingwz","html_url":"https://github.com/hongxingwz","followers_url":"https://api.github.com/users/hongxingwz/followers","following_url":"https://api.github.com/users/hongxingwz/following{/other_user}","gists_url":"https://api.github.com/users/hongxingwz/gists{/gist_id}","starred_url":"https://api.github.com/users/hongxingwz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongxingwz/subscriptions","organizations_url":"https://api.github.com/users/hongxingwz/orgs","repos_url":"https://api.github.com/users/hongxingwz/repos","events_url":"https://api.github.com/users/hongxingwz/events{/privacy}","received_events_url":"https://api.github.com/users/hongxingwz/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T02:47:30Z","updated_at":"2016-12-06T02:47:30Z","body":"我也遇到了同样的问题，希望早点解决"}}
{"actor":{"display_login":"hongxingwz"}}