first commit

This commit is contained in:
2026-07-08 11:08:24 +05:30
parent a5c745ba9f
commit 7dc984ebb9
44 changed files with 7870 additions and 192 deletions
+40
View File
@@ -0,0 +1,40 @@
"use client"
import React from "react"
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend,
} from "chart.js"
import { Bar } from "react-chartjs-2"
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend)
type Props = {
labels: string[]
datasets: Array<{
label?: string
data: number[]
backgroundColor?: string | string[]
}>
}
export default function BarChart({ labels, datasets }: Props) {
const data = { labels, datasets }
const options = {
responsive: true,
maintainAspectRatio: false,
plugins: { legend: { position: "top" as const } },
scales: { y: { beginAtZero: true } },
}
return (
<div style={{ width: "100%", minHeight: 260 }}>
<Bar data={data} options={options} />
</div>
)
}