0👍
If I understood you correctly, that is your answer
let json = [{
"end_year": "",
"intensity": 6,
"sector": "Energy",
"published": "January, 09 2017 00:00:00",
"country": "United States of America",
},
{
"end_year": "",
"intensity": 6,
"sector": "Two",
"published": "January, 09 2017 00:00:00",
"country": "Canada",
}
];
let sectors = json.map((obj) => {
return obj.sector
})
let countries = json.map((obj) => {
return obj.country
})
console.log('sectors:', sectors)
console.log('countries:', countries)
- Chartjs-How to change colour of specific xAxis label in charts js
- Chartjs-Chartjs ignore values and draw chart
Source:stackexchange.com