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 2021/12/04 07:18:14 UTC

[GitHub] [echarts] echarts-bot[bot] commented on issue #16170: echarts 树状图点击label标签 和symbol 子节点都会收起来 不能实现分离 点击symbol收起或者展开 点击lable获取节点信息但是不要展开或者收起子节点

echarts-bot[bot] commented on issue #16170:
URL: https://github.com/apache/echarts/issues/16170#issuecomment-985983351


   @tomatosqq It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   Echarts tree map clicks on the label label and symbol sub-nodes will be put away Can't achieve separation Click symbol to recege or expand Click on the cable to get node information but not expand or recant the child node
   
   **BODY**
   
   ### Version
   
   5.2.2
   
   ### Link to minimal reproduction
   
   _No response_
   
   ### Steps To Reproduce
   
   const data = {
           name: "Device One",
           children: [
             {
               name: "Device One",
               children: [
                 {
                   name: "Device One",
                   children: [
                     {name: "Device One", value: 721 },
                     {name: "Device One", value: 4294 },
                   ],
                 },
                 {
                   name: "Device One",
                   value: 3322,
                 },
               ],
             },
             {
               name: "Device One",
               children: [
                 {name: "Device One", value: 1616 },
                 {name: "Device One", value: 1027 },
                 {
                   name: "Device One",
                   children: [
                     {name: "Device One", value: 593 },
                     {name: "Device One", value: 330 },
                     {name: "Device One", value: 287 },
                   ],
                 },
                 {name: "Device One", value: 843 },
               ],
             },
             {
               name: "Device One",
               children: [
                 {name: "Device One", value: 2105 },
                 {name: "Device One", value: 1316 },
                 {name: "Device One", value: 3151 },
                 {name: "Device One", id: 9, value: 5833 },
               ],
             },
           ],
         };
         let option = {
           tooltip: {
             trigger: "item",
             triggerOn: "mousemove",
           },
           series: [
             {
               type: "tree",
               id: 0,
               name: "tree1",
               data: [data],
               top: "10%",
               left: "8%",
               bottom: "22%",
               right: "20%",
               symbolSize: 10,
               edgeShape: "curve",
               edgeForkPosition: "63%",
               initialTreeDepth: 3,
               selectedMode: false,
               lineStyle: {
                 width: 2,
                 color: "#000",
               },
               itemStyle: {
                 color: "blue",
               },
               label: {
                 backgroundColor: "#fff",
                 borderWidth: 1,
                 borderColor: "green",
                 borderRadius: 2,
                 padding: [3, 5],
                 color: "green",
                 position: "right",
                 verticalAlign: "middle",
                 align: "left",
                 fontSize: 14,
               },
               leaves: {
                 label: {
                   position: "right",
                   verticalAlign: "middle",
                   align: "left",
                 },
               },
               emphasis: {
                 focus: "series",
               },
               expandAndCollapse: true,
               animationDuration: 550,
               animationDurationUpdate: 750,
             },
           ],
         };
         this.dom = echarts.init(this.$refs.dom, "tdTheme");
         this.dom.setOption(option);
         this.dom.on(
           "click",
           function (param) {
             console.log(param);
             if (!param.event.target.culling) {
               console.log("dot text");
             } else {
               console.log("icon");
             }
           },
           false
         );
   
   ### Current Behavior
   
   Clicking on the symbol and label of the dendrogram has the same effect and cannot be separated.
   
   ### Expected Behavior
   
   I hope to click on the label to get the node information, but do not collapse or expand the child nodes. Click the symbol to collapse or expand the child nodes.
   
   ### Environment
   
   ```markdown
   -OS:
   -Browser:
   -Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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