From ab7e5d01f5dc50994ad204bd62c1332143761896 Mon Sep 17 00:00:00 2001 From: Valtteri Kantanen Date: Mon, 14 Oct 2024 14:16:09 +0300 Subject: [PATCH] [Class statistics] Credit distribution development: Fix edge case on categories --- .../CreditGainStats/CreditDistributionDevelopment.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditDistributionDevelopment.jsx b/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditDistributionDevelopment.jsx index 5734249d29..8b4efea4ae 100644 --- a/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditDistributionDevelopment.jsx +++ b/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditDistributionDevelopment.jsx @@ -99,7 +99,13 @@ const getChartData = (students, timeSlots, programme, timeDivision, cumulative, const [min, max] = limit - return (min === undefined || credits > min) && (max === undefined || credits <= max) + if (min == null) { + return credits < max + } + if (max == null) { + return credits >= min + } + return credits >= min && credits < max }) data[rangeIndex][timeSlotIndex].y += 1