diff --git a/src/components/UserResultChart.tsx b/src/components/UserResultChart.tsx
index 06d48af5..f9b3d826 100644
--- a/src/components/UserResultChart.tsx
+++ b/src/components/UserResultChart.tsx
@@ -9,11 +9,12 @@ interface Props {
label?: string;
title: string;
type: string;
+ colors?: string[];
}
ChartJS.register(RadialLinearScale, ArcElement, Tooltip, Legend);
-export default function UserResultChart({data, type, label, title}: Props) {
+export default function SingleDatasetChart({data, type, label, title, colors = Object.values(SEMI_TRANSPARENT)}: Props) {
const labels = data.map((x) => x.label);
const chartData = {
labels,
@@ -21,7 +22,7 @@ export default function UserResultChart({data, type, label, title}: Props) {
{
label,
data: data.map((x) => x.value),
- backgroundColor: Object.values(SEMI_TRANSPARENT),
+ backgroundColor: colors,
},
],
};
diff --git a/src/constants/chartColors.json b/src/constants/chartColors.json
new file mode 100644
index 00000000..0913df33
--- /dev/null
+++ b/src/constants/chartColors.json
@@ -0,0 +1,68 @@
+[
+ "#3f3f46",
+ "#6b7280",
+ "#d6d3d1",
+ "#15803d",
+ "#fdba74",
+ "#7dd3fc",
+ "#0f766e",
+ "#fda4af",
+ "#ef4444",
+ "#d4d4d4",
+ "#ec4899",
+ "#0ea5e9",
+ "#14b8a6",
+ "#4d7c0f",
+ "#93c5fd",
+ "#404040",
+ "#f97316",
+ "#bef264",
+ "#cbd5e1",
+ "#6366f1",
+ "#8b5cf6",
+ "#6ee7b7",
+ "#fcd34d",
+ "#0369a1",
+ "#64748b",
+ "#71717a",
+ "#374151",
+ "#d4d4d8",
+ "#d946ef",
+ "#44403c",
+ "#10b981",
+ "#3b82f6",
+ "#f59e0b",
+ "#d8b4fe",
+ "#f0abfc",
+ "#c4b5fd",
+ "#86efac",
+ "#fca5a5",
+ "#5eead4",
+ "#f43f5e",
+ "#eab308",
+ "#b91c1c",
+ "#a855f7",
+ "#0e7490",
+ "#06b6d4",
+ "#b45309",
+ "#6d28d9",
+ "#a21caf",
+ "#84cc16",
+ "#67e8f9",
+ "#047857",
+ "#22c55e",
+ "#be185d",
+ "#334155",
+ "#be123c",
+ "#a5b4fc",
+ "#1d4ed8",
+ "#f9a8d4",
+ "#a16207",
+ "#7e22ce",
+ "#78716c",
+ "#fde047",
+ "#737373",
+ "#c2410c",
+ "#4338ca",
+ "#d1d5db"
+]
\ No newline at end of file
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 6f1be7d9..b09b47ec 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -1,6 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import Head from "next/head";
-import UserResultChart from "@/components/UserResultChart";
+import SingleDatasetChart from "@/components/UserResultChart";
import Navbar from "@/components/Navbar";
import ProfileCard from "@/components/ProfileCard";
import {withIronSessionSsr} from "iron-session/next";
@@ -72,7 +72,7 @@ export default function Home({user}: {user: User}) {
{!isLoading && stats && (