You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/01/02 02:29:09 UTC

[GitHub] [incubator-echarts] zhangsenhua commented on issue #8597: 关系图 data 的 name 属性不允许重复,会报错。

zhangsenhua commented on issue #8597: 关系图 data 的 name 属性不允许重复,会报错。
URL: https://github.com/apache/incubator-echarts/issues/8597#issuecomment-570105283
 
 
   ```javascript
   option = {
       series : [
           {
               type: 'graph',
               layout: 'circular',
               symbolSize: 50,
               roam: true,
               label: {
                   show: true,
                   position: 'bottom',
                   formatter: params => params.data.value
               },
               edgeSymbol: ['none', 'arrow'],
               data: [{
                   name: '1',// use id or key
                   value: '节点1',// use display name or value
               }, {
                   name: '2',
                   value: '节点2',
               }, {
                   name: '3',
                   value: '节点3',
               }, {
                   name: '4',
                   value: '节点3',
               }],
               links: [{
                   source: '1',
                   target: '3'
               }, {
                   source: '2',
                   target: '3'
               }, {
                   source: '1',
                   target: '4'
               }, {
                   source: '2',
                   target: '4'
               }],
           }
       ]
   };
   ```
   [Demo: 关系图支持相同 name 节点显示](https://gallery.echartsjs.com/editor.html?c=x0793oC44)
   @xiashuyuan 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org