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 2022/08/26 09:39:39 UTC

[GitHub] [echarts] weihaopeng commented on issue #17577: [Bug] dispatchAction select with dataIndex, but some nodes that are not in the array but have the same name as a node in the array are selected

weihaopeng commented on issue #17577:
URL: https://github.com/apache/echarts/issues/17577#issuecomment-1228284390

   In case the link expires.
   
   ```
   var dom = document.getElementById("chart-container");
   var myChart = echarts.init(dom, null, {
     renderer: "canvas",
     useDirtyRect: false
   });
   var option = {
     animationDuration: 1500,
     animationEasingUpdate: "quinticInOut",
     series: [
       {
         name: "simple force",
         type: "graph",
         layout: "force",
         data: [
           { id: 0, name: "root", symbolSize: 30 },
           { id: 1, name: "a" },
           { id: 2, name: "b" },
           { id: 3, name: "c" },
           { id: 4, name: "a" }
         ],
         links: [
           { source: 0, target: 1 },
           { source: 1, target: 2 },
           { source: 0, target: 3 },
           { source: 3, target: 4 }
         ],
         label: {
           show: true,
           position: "right",
           formatter: "{b}"
         },
         selectedMode: "multiple",
         select: {
           disabled: false,
           itemStyle: {
             color: "red"
           }
         }
       }
     ]
   };
   myChart.setOption(option);
   
   if (option && typeof option === "object") {
     myChart.setOption(option);
   }
   
   window.addEventListener("resize", myChart.resize);
   
   myChart.on("finished", () => {
     setTimeout(() => {
       myChart.dispatchAction({
         type: "select",
         dataIndex: [4, 3, 0]
       });
     }, 3000);
   });
   ```


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