upd: divisi
Deskripsi: - input date - laporan divisi NoIssues
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user