IO-1911 Add target to tt scoreboard.

This commit is contained in:
Patrick Fic
2022-06-10 10:57:51 -07:00
parent 446bd9035f
commit 2c760948c5
4 changed files with 26 additions and 20 deletions

View File

@@ -6,7 +6,9 @@ import {
Bar,
CartesianGrid,
ComposedChart,
LabelList,
Legend,
ReferenceLine,
ResponsiveContainer,
Tooltip,
XAxis,
@@ -48,13 +50,15 @@ export function ScoreboardTicketsBar({ data, bodyshop }) {
<YAxis strokeWidth={graphProps.strokeWidth} />
<Tooltip />
<Legend />
{/* <Area
type="monotone"
name="Accumulated Hours"
dataKey="accHrs"
fill="lightgreen"
stroke="green"
/> */}
<ReferenceLine
y={
bodyshop.scoreboard_target.dailyBodyTarget +
bodyshop.scoreboard_target.dailyPaintTarget
}
label="Daily Target"
stroke="red"
strokeDasharray="3 3"
/>
{data &&
data.employees.map((e, idx) => (
<Bar
@@ -64,16 +68,10 @@ export function ScoreboardTicketsBar({ data, bodyshop }) {
stackId="productive"
// barSize={20}
fill={data.colors[idx]}
/>
>
<LabelList position="top" />
</Bar>
))}
{/* <Line
name="Target Hours"
type="monotone"
dataKey="accTargetHrs"
stroke="#ff7300"
strokeWidth={graphProps.strokeWidth}
/> */}
</ComposedChart>
</ResponsiveContainer>
</Card>

View File

@@ -19,7 +19,7 @@ export default connect(
export function ScoreboardTicketsStats({ data, bodyshop }) {
const { t } = useTranslation();
console.log(data);
const columns = [
{
title: t("employees.fields.employee_number"),
@@ -97,6 +97,14 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
/>
</Col>
</Row>
<Row gutter={[16, 16]}>
<Col span={12}>
<Statistic
title={t("scoreboard.labels.totaloverperiod")}
value={data.totalOverPeriod.toFixed(1)}
/>
</Col>
</Row>
<Typography.Text type="secondary">
{t("scoreboard.labels.calendarperiod")}
</Typography.Text>

View File

@@ -60,7 +60,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE = gql`
`;
export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql`
query QUERY_TIME_TICKETS_IN_RANGE(
query QUERY_TIME_TICKETS_IN_RANGE_SB(
$start: date!
$end: date!
$fixedStart: date!

View File

@@ -1,4 +1,4 @@
import Icon, { BarsOutlined } from "@ant-design/icons";
import Icon, { FieldTimeOutlined } from "@ant-design/icons";
import { Tabs } from "antd";
import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";
@@ -70,7 +70,7 @@ export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) {
<Tabs.TabPane
tab={
<span>
<BarsOutlined />
<FieldTimeOutlined />
{t("scoreboard.labels.timetickets")}
</span>
}