From 26d17ae8097c491a42484acf65169f46644d1c43 Mon Sep 17 00:00:00 2001 From: Seb-sti1 <65665540+seb-sti1@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:47:03 +0200 Subject: [PATCH] Chart.js: Fix import for production --- frontend/src/Components/RoadDetails/ConditionsGraph.tsx | 1 + frontend/src/pages/RoadDetails.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/Components/RoadDetails/ConditionsGraph.tsx b/frontend/src/Components/RoadDetails/ConditionsGraph.tsx index 0f15f27f..51ede9fc 100644 --- a/frontend/src/Components/RoadDetails/ConditionsGraph.tsx +++ b/frontend/src/Components/RoadDetails/ConditionsGraph.tsx @@ -15,6 +15,7 @@ import { Title, Tooltip, } from 'chart.js'; +import 'chart.js/auto'; import { Scatter } from 'react-chartjs-2'; Chart.register( diff --git a/frontend/src/pages/RoadDetails.tsx b/frontend/src/pages/RoadDetails.tsx index 81c19c31..2573f18c 100644 --- a/frontend/src/pages/RoadDetails.tsx +++ b/frontend/src/pages/RoadDetails.tsx @@ -23,8 +23,8 @@ const RoadDetails = () => { labels: wc.map((p) => p.way_dist * 100), datasets: [ { - //@ts-ignore - type: 'line' as const, + type: 'scatter' as const, + showLine: true, label: 'KPI', borderColor: 'rgb(255, 99, 132)', borderWidth: 2, @@ -34,8 +34,8 @@ const RoadDetails = () => { yAxisID: 'KPI', }, { - //@ts-ignore - type: 'line' as const, + type: 'scatter' as const, + showLine: true, label: 'DI', borderColor: 'rgb(120, 245, 23)', borderWidth: 2,