过滤Echart

   const filterData = res.data.fiveYear.reduce((pre, obj) => {
            const item = pre.find((o) => o.name === obj.name);
            item
              ? (item[obj.term] = obj.value)
              : pre.push({ name: obj.name, [obj.term]: obj.value });
            return pre;
          }, []);

你可能感兴趣的:(过滤Echart)