I have an object, where i want to calculate the percentage and display in the maps, currently the data i am getting is a raw data in an object.
Here is the object that i am receiving from backend
[{
"date": "26/08/2021",
"walking": 965.2107,
"running": 964.0539,
"sleeping": 962.1473,
"swimming": 961.8081,
"studying": 961.5081,
}]
Based on the object i want the percentage to be calculated and replaced in the respective key/value pair. It will take the object value, sum it up and calculate the percentage. This is what i am expecting to return
[{
"date": "26/08/2021",
"walking": 20,
"running": 20,
"sleeping": 20,
"swimming": 20,
"studying": 20,
}]