Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/components/dashboard/registrations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,30 @@ const RegistrationChart = ({ round, ghostLegion }) => {
const labels = [],
data = [],
colors = [];

// Group universities by normalized (lowercase) name to handle case-insensitive aggregation
const universityMap = new Map();

registrationInfo?.university_counts?.forEach((university) => {
const normalizedName = university.name.toLowerCase();
if (universityMap.has(normalizedName)) {
const existing = universityMap.get(normalizedName);
existing.count += university.count;
} else {
universityMap.set(normalizedName, {
name: university.name,
count: university.count
});
}
});

// Convert map to arrays for the chart
universityMap.forEach((university) => {
labels.push(university.name);
data.push(university.count);
colors.push("#ffcccc");
});

return { labels, data, colors };
}, [registrationInfo]);

Expand Down
Loading