modify analytics
This commit is contained in:
parent
cddd8c1814
commit
4a9131a562
@ -1,9 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { Bar, BarChart, XAxis, YAxis } from "recharts";
|
import { Bar, BarChart, CartesianGrid, XAxis, YAxis } from "recharts";
|
||||||
|
|
||||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart";
|
import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart";
|
||||||
import { StopwatchIcon } from "@radix-ui/react-icons";
|
|
||||||
|
|
||||||
export const description = "Ein horizontales Balkendiagramm zur Darstellung der durchschnittlichen Leerlaufzeit";
|
export const description = "Ein horizontales Balkendiagramm zur Darstellung der durchschnittlichen Leerlaufzeit";
|
||||||
|
|
||||||
@ -37,9 +36,10 @@ export function PrinterIdleTimeChart({ printerIdleTime }: PrinterIdleTimeChartPr
|
|||||||
<CardDescription>Durchschnittliche Leerlaufzeit der Drucker in Minuten</CardDescription>
|
<CardDescription>Durchschnittliche Leerlaufzeit der Drucker in Minuten</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<ChartContainer className="h-64" config={chartConfig}>
|
<ChartContainer className="h-64 w-full" config={chartConfig}>
|
||||||
<BarChart accessibilityLayer data={chartData} layout="vertical">
|
<BarChart accessibilityLayer data={chartData} layout="vertical">
|
||||||
<XAxis type="number" dataKey="idleTime" hide />
|
<CartesianGrid vertical={true} />
|
||||||
|
<XAxis type="number" dataKey="idleTime" label={"Minuten"} />
|
||||||
<YAxis
|
<YAxis
|
||||||
dataKey="printer"
|
dataKey="printer"
|
||||||
type="category"
|
type="category"
|
||||||
@ -54,11 +54,8 @@ export function PrinterIdleTimeChart({ printerIdleTime }: PrinterIdleTimeChartPr
|
|||||||
</ChartContainer>
|
</ChartContainer>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardFooter className="flex-col items-start gap-2 text-sm">
|
<CardFooter className="flex-col items-start gap-2 text-sm">
|
||||||
<div className="flex gap-2 font-medium leading-none">
|
|
||||||
Durchschnittliche Leerlaufzeiten der Drucker <StopwatchIcon className="h-4 w-4" />
|
|
||||||
</div>
|
|
||||||
<div className="leading-none text-muted-foreground">
|
<div className="leading-none text-muted-foreground">
|
||||||
Zeigt die durchschnittliche Leerlaufzeit für jeden Drucker
|
Zeigt die durchschnittliche Leerlaufzeit für jeden Drucker in Minuten
|
||||||
</div>
|
</div>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -36,7 +36,7 @@ export function PrinterVolumeChart({ printerVolume }: PrinterVolumeChartProps) {
|
|||||||
<CardDescription>Vergleich: Heute, Diese Woche, Diesen Monat</CardDescription>
|
<CardDescription>Vergleich: Heute, Diese Woche, Diesen Monat</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<ChartContainer className="h-64" config={chartConfig}>
|
<ChartContainer className="h-64 w-full" config={chartConfig}>
|
||||||
<BarChart
|
<BarChart
|
||||||
accessibilityLayer
|
accessibilityLayer
|
||||||
data={chartData}
|
data={chartData}
|
||||||
|
@ -22,7 +22,7 @@ export function calculatePrinterIdleTime(
|
|||||||
const now = new Date();
|
const now = new Date();
|
||||||
const startOfThisMonth = startOfMonth(now);
|
const startOfThisMonth = startOfMonth(now);
|
||||||
const endOfThisMonth = endOfMonth(now);
|
const endOfThisMonth = endOfMonth(now);
|
||||||
const totalMinutesInMonth = (endOfThisMonth.getTime() - startOfThisMonth.getTime()) / (1000 * 60);
|
const totalMinutesInMonth = 60 * 70 * 4; // 60min * 70h (35*2) * 4 Weeks
|
||||||
|
|
||||||
const usedTimePerPrinter: Record<string, number> = pJobs.reduce(
|
const usedTimePerPrinter: Record<string, number> = pJobs.reduce(
|
||||||
(acc, job) => {
|
(acc, job) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user