export const parseSystemObj = ( obj ) => { const names = Object . keys ( obj ) ; return names . map ( ( name ) => ( { name , value : obj [ name ] } ) ) . sort ( ( a , b ) => b . value - a . value ) ; } ; export const parseData = ( data ) => { return data . reduce ( ( obj , item ) => { obj . legendData . push ( item . name ) ; obj . seriesData . push ( item ) ; return obj ; } , { legendData : [ ] , seriesData : [ ] } as { legendData : string [ ] ; seriesData : any [ ] ; } ) ; } ;