mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
a160eccddf
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.
122 lines
3.3 KiB
TypeScript
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>
|
|
)
|
|
} |