diff --git a/web/src/aggregator/chart/CityChart.tsx b/web/src/aggregator/chart/CityChart.tsx index b33c93e..9689c71 100644 --- a/web/src/aggregator/chart/CityChart.tsx +++ b/web/src/aggregator/chart/CityChart.tsx @@ -24,7 +24,7 @@ export const CityChart: Component<{ const values = data.map(item => item[1]); onMount(() => { - const ctx = getCanvas()!.getContext('2d')!; + const ctx = getCanvas()!.getContext("2d")!; chart = createCustomChart( ctx, false, diff --git a/web/src/aggregator/chart/CityResult.tsx b/web/src/aggregator/chart/CityResult.tsx index c8c477b..767ef48 100644 --- a/web/src/aggregator/chart/CityResult.tsx +++ b/web/src/aggregator/chart/CityResult.tsx @@ -19,7 +19,12 @@ function isDateNumber(value: unknown): value is [string, number | null][] { if (!Array.isArray(value)) return false; for (let i = 0; i < value.length; i++) { let item = value[i]; - if (!Array.isArray(item) || item.length !== 2 || typeof item[0] !== 'string' || (typeof item[1] !== 'number' && item[1] !== null)) { + if ( + !Array.isArray(item) + || item.length !== 2 + || typeof item[0] !== "string" + || (typeof item[1] !== "number" && item[1] !== null) + ) { return false; } } diff --git a/web/src/aggregator/chart/CustomChart.ts b/web/src/aggregator/chart/CustomChart.ts index 2177d2d..202e7f1 100644 --- a/web/src/aggregator/chart/CustomChart.ts +++ b/web/src/aggregator/chart/CustomChart.ts @@ -10,7 +10,7 @@ import { Title, } from "chart.js"; -// Register the controllers, elements, scales, and plugins we'll be using +// Register chart elements which will be used Chart.register( BarElement, BarController, @@ -22,9 +22,7 @@ Chart.register( CategoryScale, ); -// Chart.defaults.backgroundColor = "#FF0000"; - -const barChartData = ["precipitation", "sunDuration"]; +const barChartData = ["precipitation", "sunDuration", "snowAvg"]; export function createCustomChart( ctx: CanvasRenderingContext2D,