diff --git a/src/lib/entities.ts b/src/lib/entities.ts index f8fd112..cc84166 100644 --- a/src/lib/entities.ts +++ b/src/lib/entities.ts @@ -146,6 +146,7 @@ export interface StatsType { export interface StatsTypeCurrencyChart { label: string; elements: StatsType[]; + total: number; } // {{{ Settings section diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 9bda20a..ea20968 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -9,6 +9,7 @@ type ChartConfiguration, } from "chart.js"; import type { StatsTypeCurrencyChart } from "$lib/entities"; + import { NumberToFPA } from "$lib/util/fpa"; Chart.register(DoughnutController, ArcElement, Tooltip, Legend); @@ -33,7 +34,7 @@ labels: chart.elements.map((type) => type.name), datasets: [ { - label: "Chart Dataset", + label: chart.label, data: chart.elements.map((type) => type.value / 100), backgroundColor: chart.elements.map((type) => type.color), }, @@ -66,15 +67,23 @@ {/if} -