0👍
First you filter it by each category, then make an array of language Strings. Then make object that holds each language appearance by counting it.
const categroy1data = data.filter(val => val.category === 1).map(val => val.language);
// => ['Danish', 'Dutch', 'Spanish' ... ]
const category1result = {}
category1data.forEach(val => {
category1result[val] = 1 + (category1result[val] || 0)
})
// {
// Danish: 3,
// Dutch: 2,
// Spanih: 1,
// }
- Chartjs-How can I build a vertical line without going through my dots on my line graph? (charts.js)
- Chartjs-Responsive Chart.js Canvas barplot height?
Source:stackexchange.com