upd: divisi
Deskripsi: - input date - laporan divisi NoIssues
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -2,7 +2,7 @@ import Styles from "@/constants/Styles";
|
||||
import { Text, View } from "react-native";
|
||||
import { PieChart } from "react-native-gifted-charts";
|
||||
|
||||
export default function ReportChartProgress() {
|
||||
export default function ReportChartProgress({ data }: { data: { color: string; text: string; value: number; }[] }) {
|
||||
const pieData = [
|
||||
{ value: 54, text: "54%", color: '#177AD5' },
|
||||
{ value: 40, text: "40%", color: '#92cc76' },
|
||||
@@ -14,7 +14,7 @@ export default function ReportChartProgress() {
|
||||
<View style={[Styles.wrapPaper, Styles.contentItemCenter, Styles.mb15]}>
|
||||
<Text style={[Styles.textSubtitle, Styles.mv15]}>PROGRES KEGIATAN</Text>
|
||||
<PieChart
|
||||
data={pieData}
|
||||
data={data}
|
||||
showText
|
||||
showValuesAsTooltipText
|
||||
textColor="black"
|
||||
|
||||
Reference in New Issue
Block a user