I'm currently tackling a project in Ionic 3 where I am utilizing an API that returns a JSON response with nested objects. My goal is to display certain aspects of these objects within a bar graph using chart.js.
Unfortunately, I lack experience in manipulating JSON objects.
{
"fruits": [
{
"oranges": {
"good": 1,
"not_good": 0
},
"apples": {
"good": 1,
"not_good": 0
},
"grapes": {
"good": 2,
"not_good": 0
}
}]
}
It's uncertain how many fruits will be included in the response.
The names of the fruits would serve as the labels for the graph, while the 'good' and 'not good' values would make up the datasets.