diff --git a/frontend/src/lib/getChartData.ts b/frontend/src/lib/getChartData.ts index 494dd76583..4bb8789ad4 100644 --- a/frontend/src/lib/getChartData.ts +++ b/frontend/src/lib/getChartData.ts @@ -63,10 +63,6 @@ const getChartData = ({ }), ); - const allLabels = response - .map((e) => e.map((e) => e.label)) - .reduce((a, b) => [...a, ...b], []); - const modifiedData = response .flat() .sort((a, b) => { @@ -89,6 +85,8 @@ const getChartData = ({ ? modifiedData.slice(0, limit) : modifiedData; + const allLabels = modifiedData.map((e) => e.label); + const updatedDataSet = updatedSortedData.map((e, index) => { const datasetBaseConfig = { index,