From dc771db3e43232870ee732ce929f2e97e621cf63 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 17 Feb 2024 02:49:44 +0100 Subject: [PATCH] Adjust Chart --- src/components/FightStatsChart.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/FightStatsChart.svelte b/src/components/FightStatsChart.svelte index 297a554..de4c68c 100644 --- a/src/components/FightStatsChart.svelte +++ b/src/components/FightStatsChart.svelte @@ -34,7 +34,7 @@ import 'chartjs-adapter-dayjs-4' export let data: FightStats; - let chart: Chart; + let chart: Chart<"line", {x: string; y: number}[], unknown>; let canvas: HTMLCanvasElement; onMount(async () => { @@ -43,7 +43,7 @@ Chart.defaults.color = "#fff" } - const colors = ["#abfa91", "#279900", "#00ffbe", "#9297fb", "#050b9d", "#b60fff", "#8dddfc", "#0880ad", "#41ff00", "#039973", "#96fce2", "#0009ff", "#7501a4", "#e2a2fb", "#00b9ff"]; + const colors = ["#abfa91", "#279900", "#00ffbe", "#9297fb", "#050b9d", "#b60fff", "#8dddfc", "#0880ad", "#41ff00", "#039973", "#96fce2", "#0009ff", "#7501a4", "#e2a2fb", "#00b9ff", "#372a42", "#dee0da", "#dec5ed", "#e1be89", "#330c3d"]; const map = new Map() for (const point of data) { const dataset = map.get(point.gamemode) ?? [] @@ -69,6 +69,7 @@ borderColor: color, backgroundColor: color, spanGaps: true, + cubicInterpolationMode: "monotone", data }; })