Chartjs-ChartJS ReactJS Object of Objects

0👍

First extract the labels:

const labels = Object.keys(data);

Then the values:

const found = labels.map(label => data[label].found);
const lost= labels.map(label => data[label].lost);

Leave a comment