Is there a way to merge objects with the same date into one cohesive data set? I could use some guidance.
const info = [
{ date: '1 Day', green: 35 },
{ date: '2 Day', green: 64 },
{ date: '3 Day', green: 46 },
{ date: '4 Day', green: 87 },
{ date: '5 Day', green: 32 },
{ date: '1 Day', red: 85 },
{ date: '2 Day', red: 55 },
{ date: '3 Day', red: 37 },
{ date: '1 Day', orange: 4 },
{ date: '2 Day', orange: 44 },
{ date: '3 Day', orange: 9 },
{ date: '4 Day', orange: 88 },
{ date: '5 Day', orange: 60 },
{ date: '6 Day', orange: 15 },
];
Ideally, the output should look like this:
const info = [
{ date: '1 Day', green: 35, red: 85, orange: 4 },
{ date: '2 Day', green: 64, red: 55, orange: 44 },
{ date: '3 Day', green: 46, red: 37, orange: 9 },
{ date: '4 Day', green: 87, orange: 88 },
{ date: '5 Day', green: 32, orange: 60 },
{ date: '6 Day', orange: 15 },
]