[CourseStatistics] Change the location where barchart direction is done, previous breaks attempts

This commit is contained in:
Aaro Koivukangas
2026-08-20 12:47:48 +03:00
parent bf54702cd7
commit 00feec055c
2 changed files with 12 additions and 10 deletions
@@ -148,15 +148,18 @@ export const ResultTab = ({
/>
{datasets
.filter(data => data !== undefined)
.map(data => (
<PassRateChart
data={data}
isRelative={settings.isRelative}
key={data.name}
userHasAccessToAllStats={userHasAccessToAllStats}
viewMode={settings.viewMode}
/>
))}
.map(data => {
data.stats.sort((a, b) => a.code - b.code) // Needs to be sorted ASC so that years on the barchart go from left to right
return (
<PassRateChart
data={data}
isRelative={settings.isRelative}
key={data.name}
userHasAccessToAllStats={userHasAccessToAllStats}
viewMode={settings.viewMode}
/>
)
})}
</Section>
)}
</>
@@ -390,7 +390,6 @@ export const SingleCourseStats = ({
}
}
)
.sort((a, b) => a.code - b.code) // Needs to be sorted back to ASC so that years on the barchart go from left to right
const totals = countTotalStats(formattedStats)
const programmeStats: ProgrammeStats = {