Files
hats-app/app/(dashboard)/components/Overview.tsx
T
Ichsan Kurniawan a160eccddf fixing typescript error during production build
Adjust chart components (Overview, PieChart) for sizing and safer typings/casting; add v1.2.0 release note. Remove several obsolete dummy/old task pages and the useDummyTaskData hook. Also include minor fixes to FormClient and DonutChart/performance pages.
2026-04-23 21:36:42 +07:00

122 lines
3.3 KiB
TypeScript

"use client"
import Chart from 'react-apexcharts';
import { type ApexOptions } from 'apexcharts';
import { useTheme } from "next-themes";
export default function Overview() {
const { theme } = useTheme()
const barChartDataDailyTraffic = [
{
name: "Daily Traffic",
data: [
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
Math.floor(Math.random() * 5000) + 1000,
],
},
];
const barChartOptionsDailyTraffic: ApexOptions = {
chart: {
toolbar: {
show: false,
},
},
tooltip: {
theme: theme,
},
xaxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
labels: {
show: true,
style: {
colors: theme === 'dark' ? '#fff' : "#707070",
},
},
axisBorder: {
show: false,
},
axisTicks: {
show: false,
},
},
yaxis: {
show: false,
labels: {
show: true,
style: {
colors: "#CBD5E0",
fontSize: "14px",
},
},
},
grid: {
show: false,
strokeDashArray: 5,
yaxis: {
lines: {
show: true,
},
},
xaxis: {
lines: {
show: false,
},
},
},
fill: {
type: "gradient",
gradient: {
type: "vertical",
shadeIntensity: 1,
opacityFrom: 0.7,
opacityTo: 0.9,
colorStops: [
[
{
offset: 0,
color: "#adfa1d",
opacity: 1,
},
{
offset: 100,
color: "#00ff00",
opacity: 0.28,
},
],
],
},
},
dataLabels: {
enabled: false,
},
plotOptions: {
bar: {
borderRadius: 5,
},
}
};
return (
<div className="w-full h-68.75 sm:h-105 2xl:h-112.5">
<Chart
options={barChartOptionsDailyTraffic}
series={barChartDataDailyTraffic}
type="bar"
width="100%"
height="100%"
/>
</div>
)
}