使用echarts做关系图谱报错 问题解答 后台返回到数据报错,节点ID相同 去除对象相同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)