I am using high charts in angular 8.I am getting chart for single object in an array of objects but i want to get each chart for each object dynamically how to achieve that. Below I have attached my working stackblitz for reference.
JSON:
[
{
"nameList":[
{
"id":203,
"Namelist_constrains":{
},
"lists":[
{
"name":"books",
"data":{
"A15people":4285,
"A30people":4285,
"A90people":4285
}
},
{
"name":"paper",
"data":{
"A15people":4285,
"A30people":4285,
"A90people":4285
}
},
{
"name":"pen",
"data":{
"A15people":4285,
"A30people":4285,
"A90people":4285
}
},
{
"name":"ball",
"data":{
"A15people":4285,
"A30people":4285,
"A90people":4285
}
},
{
"name":"bat",
"data":{
"A15people":4285,
"A30people":4285,
"A90people":4285
}
}
]
},
{
"id":204,
"Namelist_constrains":{
},
"lists":[
{
"name":"books",
"data":{
"A15people":5004,
"A30people":345,
"A90people":1334
}
},
{
"name":"paper",
"data":{
"A15people":112,
"A30people":345,
"A90people":6667
}
},
{
"name":"pen",
"data":{
"A15people":9882,
"A30people":3456,
"A90people":29898
}
},
{
"name":"ball",
"data":{
"A15people":3465,
"A30people":224,
"A90people":455
}
},
{
"name":"bat",
"data":{
"A15people":876,
"A30people":234,
"A90people":664
}
}
]
}
]
}
]
For the above I need to get two charts because it have two objects.
In my stackblitz i have only one object in the json. I am little bit confused how to achieve this.help me to solve this.
Link:
https://stackblitz.com/edit/angular-highcharts-example-xqcnyv?file=src/app/app.component.ts
Inputand return standalone chart. Then you might use the*ngFordirective to generate that component for each element of your data.