Use echarts to report an error in relational graph
Questions and Answers
The background returns to the data error, the node ID is the same
Method to remove objects with the same id
let company =[ {<!-- -->id:1,name:12}, {<!-- -->id:2,name:13}, {<!-- -->id:3,name:14}, {<!-- -->id:1,name:15},] let map = new Map(); for (let item of hx) {<!-- --> if (!map.has(item.id)) {<!-- --> map.set(item.id, item); } } let obj = [...map.values()]; company = obj; console.log(company)