Skip to content

Commit a8314bb

Browse files
committed
fix: register bar chart
1 parent 8ad5c9f commit a8314bb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

web/src/pages/Home/CourtOverview/BarChart.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
import React, { useCallback } from "react";
22
import styled, { useTheme } from "styled-components";
3-
import { Chart as ChartJS, BarElement } from "chart.js";
3+
import {
4+
Chart as ChartJS,
5+
BarElement,
6+
Tooltip,
7+
CategoryScale,
8+
LinearScale,
9+
PointElement,
10+
LineElement,
11+
TimeScale,
12+
} from "chart.js";
413
import ChartDataLabels from "chartjs-plugin-datalabels";
514
import { Bar } from "react-chartjs-2";
615
import "chartjs-adapter-moment";
716

17+
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, TimeScale, Tooltip);
818
const formatter = new Intl.NumberFormat("en", { notation: "compact" });
919

1020
const BarContainer = styled.div`

0 commit comments

Comments
 (0)