score:2

Accepted answer

you can use the second argument of the map function which is the index of the element, along with the % operator to get the color dynamically.

{this.state.graphdata.map((data, index) => 
  <victoryarea
    name="area-1"
    data={data}
    style={{ data: { fill: this.color[index % this.color.length] } }}
  />
)}

Related Query

More Query from same tag