Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Chart.js: Fix import for production
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb-sti1 committed Oct 12, 2023
1 parent d7ee43c commit 683303f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions frontend/src/Components/RoadDetails/ConditionsGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Title,
Tooltip,
} from 'chart.js';
import 'chart.js/auto';
import { Scatter } from 'react-chartjs-2';

Chart.register(
Expand All @@ -36,6 +37,7 @@ const options = (): ChartOptions<'scatter'> => ({
labels: { color: 'white' },
},
},

scales: {
x: {
title: {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Components/RoadDetails/MapArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Roads from '../Map/Roads';
interface Props {
triggerUpdate: number;
}

/**
* The map area op the road details(road inspect) page
*/
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/RoadDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 683303f

Please sign in to comment.