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/01 04:17:07 UTC

[GitHub] [incubator-echarts] cpprookie opened a new issue #11860: 树图使用图片symbol后,节点只有点击才会展示

cpprookie opened a new issue #11860: 树图使用图片symbol后,节点只有点击才会展示
URL: https://github.com/apache/incubator-echarts/issues/11860
 
 
   ### Version
   4.5.0
   
   ### Steps to reproduce
   打开官网树图demo https://echarts.apache.org/examples/zh/editor.html?c=tree-basic
   替换内容为
   ```javacript
   myChart.showLoading();
   const url = `data:image/svg xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 80 40" xml:space="preserve">
       <rect x="0" y="0" width="2px" height="100%" fill="%232DAFF9" />
       <rect  x="3" y="0" width="70px" height="100%" fill="%232DAFF9" />
   </svg>`
   $.get(ROOT_PATH   'data/asset/data/flare.json', function (data) {
       myChart.hideLoading();
   
       echarts.util.each(data.children, function (datum, index) {
           index % 2 === 0 && (datum.collapsed = true);
       });
       const d = {
        "name": "flare",
        "value": "70人,80%",
        "children": [
         {
          "name": "analytics",
          "value": "70人,80%",
          "children": [
           {
            "name": "cluster",
            "children": [
             {"name": "AgglomerativeCluster", "value": 3938},
             {"name": "CommunityStructure", "value": 3812},
             {"name": "HierarchicalCluster", "value": 6714},
             {"name": "MergeEdge", "value": 743}
            ]
           },
           {
            "name": "graph",
            "children": [
             {"name": "BetweennessCentrality", "value": 3534},
             {"name": "LinkDistance", "value": 5731},
             {"name": "MaxFlowMinCut", "value": 7840},
             {"name": "ShortestPaths", "value": 5914},
             {"name": "SpanningTree", "value": 3416}
            ]
           },
           {
            "name": "optimization",
            "children": [
             {"name": "AspectRatioBanker", "value": 7074}
            ]
           }
          ]
         }]
       };
   
       myChart.setOption(option = {
           tooltip: {
               trigger: 'item',
               triggerOn: 'mousemove'
           },
           series: [
               {
                   type: 'tree',
   
                   data: [d],
   
                   top: '1%',
                   left: '7%',
                   bottom: '1%',
                   right: '20%',
                   symbol: `image://${url}`,
                   symbolSize: [80, 40],
                   itemStyle: {
                       color: '#2DAFF9',
                       borderWidth: 0,
                   },
                   label: {
                       normal: {
                           position: ['50%', '50%'],
                           verticalAlign: 'middle',
                           align: 'left',
                           fontSize: 9,
                           formatter: function(params) {
                               return `{name|${params.name}}\n${params.value}`
                           },
                           rich: {
                               name: {
                                   color: '#fff',
                               },
                               
                           }
                       },
                       
                   },
   
                   expandAndCollapse: true,
                   animationDuration: 550,
                   animationDurationUpdate: 750
               }
           ]
       });
   });
   ```
   
   ### What is expected?
   节点背景图片默认展示
   
   ### What is actually happening?
   节点背景图片初始不展示,点击后才会展示
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   

----------------------------------------------------------------
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