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,10 +2,11 @@ import Styles from "@/constants/Styles";
import { Dimensions, Text, View } from "react-native";
import { BarChart } from "react-native-gifted-charts";
export default function ReportChartDocument() {
export default function ReportChartDocument({ data }: { data: { label: string; value: number; }[] }) {
const maxValue = Math.max(...data.map(i => i.value))
const barData = [
{ value: 23, label: 'Gambar', frontColor: '#fac858' },
{ value: 12, label: 'Dokumen', frontColor: '#92cc76' },
{ value: 23, label: 'Gambar', },
{ value: 12, label: 'Dokumen' },
];
const width = Dimensions.get("window").width;
@@ -15,12 +16,13 @@ export default function ReportChartDocument() {
<BarChart
showFractionalValues={false}
showYAxisIndices
noOfSections={4}
maxValue={25}
data={barData}
noOfSections={maxValue < 5 ? 2 : 4}
maxValue={maxValue}
data={data}
isAnimated
width={width - 140}
barWidth={width * 0.25}
frontColor="#fac858"
renderTooltip={(item: any, index: any) => {
return (
<View