I am trying to get data by using JSON and use that data in a chart.
This is what i get from JSON
{ got json response {"id": 8900.937201864273, "jsonrpc": "2.0", "result": [{"__domain": [Array], "date:day": "07 Dec 2021", "date_count": 1, "unit_amount": 4}, {"__domain": [Array], "date:day": "08 Dec 2021", "date_count": 4, "unit_amount": 7.5}]} }
I need to put the exact dates i get as labels and unit_amount as data for the chart and I don’t know how to use parse.
const res = await countRecords();
const parseRes = JSON.parse(res);
console.log("res: ", parseRes)
If I try to console log parseRes.unit_amount I get the same result. Can anyone help me please. Thank you in advance.