So basically i have this array of objects:
const testMeasurments = [
{
data: [
{name: "glucose", value: 6, color: '#57c0e8'},
{name: "SpO2", value: 5, color: "#FF6565"},
{name: "Blood Pressure", value: 4, color: "#FFDA83"},
{name: "Body Weight", value: 2, color: "purple"}
]
}
]
I want to loop over them and access the color
property. So basically i have a chart and each part will have its own color so I want to loop inside the object while assigning the value also to assign the color to it.
Example:
{testMeasurments.map(s=>
<Pie
dataKey="value"
isAnimationActive={false}
data={s.data}
cx={200}
cy={200}
outerRadius={100}
innerRadius={60}
fill={s.color} // Here I want to loop over each color and assign it to the proper value
>
As you can see it is certainly not working here but thats what i need! Thank you in advance.