upd: divisi

Deskripsi:
- input date

- laporan divisi

NoIssues
This commit is contained in:
amel
2025-05-28 16:52:01 +08:00
parent 749afcf0eb
commit 088baec9b0
11 changed files with 353 additions and 61 deletions

View File

@@ -2,11 +2,12 @@ import Styles from "@/constants/Styles";
import { Dimensions, Text, View } from "react-native";
import { BarChart } from "react-native-gifted-charts";
export default function ReportChartEvent() {
export default function ReportChartEvent({ data }: { data: { label: string; value: number; }[] }) {
const width = Dimensions.get("window").width;
const maxValue = Math.max(...data.map(i => i.value))
const barData = [
{ value: 23, label: 'Akan Datang', frontColor: 'gray' },
{ value: 12, label: 'Selesai', frontColor: '#177AD5' },
{ value: 23, label: 'Akan Datang', },
{ value: 12, label: 'Selesai' },
];
return (
@@ -15,9 +16,10 @@ export default function ReportChartEvent() {
<BarChart
showFractionalValues={false}
showYAxisIndices
noOfSections={4}
maxValue={25}
data={barData}
noOfSections={maxValue < 5 ? 2 : 4}
maxValue={maxValue}
frontColor="#177AD5"
data={data}
isAnimated
width={width - 140}
barWidth={width * 0.25}