diff --git a/src/components/pages/uniformity/UniformityChart.tsx b/src/components/pages/uniformity/UniformityChart.tsx index 1779d5de..b89ce504 100644 --- a/src/components/pages/uniformity/UniformityChart.tsx +++ b/src/components/pages/uniformity/UniformityChart.tsx @@ -1,6 +1,10 @@ +import React from 'react'; import { Bar, BarChart, + Cell, + Pie, + PieChart, Rectangle, ResponsiveContainer, Tooltip, @@ -8,6 +12,8 @@ import { YAxis, } from 'recharts'; import Card from '@/components/Card'; +import { Icon } from '@iconify/react'; +import { formatNumber } from '@/lib/helper'; interface Payload { value?: number; @@ -21,8 +27,65 @@ interface CustomTooltipProps { label?: string | number; } +interface GaugeChartProps { + value: number; + label: string; +} + +const GaugeChart: React.FC = ({ value, label }) => { + const numberOfSegments = 50; + const filledSegments = Math.round((value / 100) * numberOfSegments); + + const data = Array.from({ length: numberOfSegments }, (_, index) => ({ + name: index, + value: 1, + filled: index < filledSegments, + })); + + const activeColor = '#1890ff'; + const inactiveColor = '#f0f0f0'; + + return ( +
+ + + + {data.map((entry, index) => ( + + ))} + + + +
+ + {value}% + +
+ + {label} + +
+
+
+ ); +}; + const UniformityChart = () => { - // #start Uniformity Sample data const data = [ { name: '48-52', @@ -76,7 +139,6 @@ const UniformityChart = () => { left: 20, bottom: 5, }; - // #end Uniformity Sample data function CustomTooltip({ payload, label, active }: CustomTooltipProps) { if (active && payload && payload.length && label !== undefined) { @@ -139,8 +201,44 @@ const UniformityChart = () => { title='Weekly Performance' className={{ wrapper: 'xl:col-span-1 w-full' }} > -
- Weekly Performance Content +
+
+ +
+ +
+
+ +
+
+
+ Kandang Cirangga + + + Week 2 + +
+
+ + {formatNumber(512)} + + From + + {formatNumber(1024)} + +
+
+
+