Skip to content

Commit 3cd084c

Browse files
committed
[FIX/PERF] Charts: fix loop condition
The "getChartLabelValues" helper would refetch all the chart data at each iteration of a loop for no reason. closes #6028 Task: 4675166 X-original-commit: 8b3aed3 Signed-off-by: Lucas Lefèvre (lul) <[email protected]> Signed-off-by: Rémi Rahir (rar) <[email protected]>
1 parent f1fd142 commit 3cd084c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/helpers/figures/charts/chart_ui_common.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ export function getChartLabelValues(
215215
};
216216
}
217217
} else if (dataSets.length === 1) {
218-
for (let i = 0; i < getData(getters, dataSets[0]).length; i++) {
218+
const dataLength = getData(getters, dataSets[0]).length;
219+
for (let i = 0; i < dataLength; i++) {
219220
labels.formattedValues.push("");
220221
labels.values.push("");
221222
}

0 commit comments

Comments
 (0)