I currently have an array structured as follows:
[{
"coin": "AION",
"profit": "3.10",
"timestamp": "2021-01-26 00:48:01"
},
{
"coin": "BTC",
"profit": "77.00",
"timestamp": "2021-01-26 00:08:04"
},
{
"coin": "AION",
"profit": "4.00",
"timestamp": "2021-01-26 01:08:01"
},
{
"coin": "BTC",
"profit": "78.10",
"timestamp": "2021-01-26 01:08:04"
}]
What I aim to achieve is the creation of four separate arrays:
array coins:
[{ "AION", "BTC" }]
(additional coins can be included based on the existing array) > AION, BTC, ETH, ZIL, ARK, etc....
array profit[AION]:
[{ "3.10", "4.00" }]
array profit[BTC]:
[{ "77.00", "78.10" }]
(additional coins/profits) [ETH, ZIL, ARK, etc...]
array timestamp:
[{ "2021-01-26 00:48","2021-01-26 01:08" }]
(additional timestamps based on the initial array)
This information is crucial for populating the chartsData array for am4charts.LineSeries.
Is there anyone who can assist me with this task? Alternatively, are there any better approaches available?