Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
Error: "line" is not a registered controller.
  • Loading branch information
aahna-ashina committed Nov 15, 2022
1 parent 03f547f commit b1005d3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React, { Context, useEffect, useRef, useState } from "react"
import { IdentificationIcon } from "@heroicons/react/24/outline"
import React, { useEffect, useRef, useState } from "react"
import type { NextPage } from "next"
import Image from "next/image"
import Link from "next/link"
import GradientLink from "../components/GradientLink"
import HomeCard from '../components/CitizenCard'
import flag from '../public/flag.svg'
import Papa from 'papaparse'
Expand All @@ -13,18 +10,20 @@ import {
CategoryScale,
LinearScale,
PointElement,
LineController,
LineElement,
Title,
Tooltip,
Legend,
Filler,
ChartData
} from 'chart.js'
import { Line } from 'react-chartjs-2'
import { Chart } from 'react-chartjs-2'
ChartJS.register(
CategoryScale,
LinearScale,
PointElement,
LineController,
LineElement,
Filler,
Title,
Expand Down Expand Up @@ -105,7 +104,7 @@ export function CitizenChart() {
})
}, [])

return <Line ref={chartRef} data={chartData} />
return <Chart type='line' ref={chartRef} data={chartData} />
}

export function CitizenList() {
Expand Down Expand Up @@ -136,7 +135,7 @@ export function CitizenList() {
<>
<div className="grid xl:grid-cols-2 mt-2 gap-8">
{
citizenData.map((citizen) => (
citizenData.map((citizen: any) => (
<HomeCard
key={citizen.passport_id}
passportId={citizen.passport_id}
Expand Down

0 comments on commit b1005d3

Please sign in to comment.