In my-scenario, I am trying to restructure the array before loading into line chart. Here,I am receiving props like: const data = [26.727, 26.952, 12.132, 25.933, 12.151, 28.492, 12.134, 26.191]
I want to restructure the data like below, before loading into line chart
const dataTwo = [{ value: 26.727, svg: { fill: Colors.WHITE, }, }, { value: 26.952, svg: { fill: Colors.WHITE, }, }, { value: 12.132, svg: { fill: Colors.WHITE, }, },, { value: 25.933, svg: { fill: Colors.WHITE, }, }, { value: 12.151, svg: { fill: Colors.WHITE, }, }, { value: 28.492, svg: { fill: Colors.WHITE, }, },, { value: 12.134, svg: { fill: Colors.RED, }, }, { value: 12.134, svg: { fill: Colors.WHITE, }, },
The array of last before index, I need to insert unique colour value.