Changed Chart Labels

This commit is contained in:
2025-11-29 14:25:26 -05:00
parent 95b3ce9e29
commit 2dacc47801
3 changed files with 7 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ import {
import { LineChartArr } from "@/types/LineChartStats"; import { LineChartArr } from "@/types/LineChartStats";
interface LineChartComponentProps { interface LineChartComponentProps {
label: "Triggers" | "Links Deleted" | "Commands"; label: "Times Triggered" | "Links Deleted" | "Command Responses";
data: LineChartArr; data: LineChartArr;
} }
@@ -32,14 +32,14 @@ const LineChartComponent = ({
// axisLine={false} // axisLine={false}
dataKey={chart.key("day")} dataKey={chart.key("day")}
stroke={chart.color("border")} stroke={chart.color("border")}
label={{ value: "Day", position: "bottom" }} // label={{ value: "Day", position: "bottom" }}
/> />
<YAxis <YAxis
// axisLine={false} // axisLine={false}
tickLine={false} tickLine={false}
tickMargin={10} tickMargin={10}
stroke={chart.color("border")} stroke={chart.color("border")}
label={{ value: label, position: "left", angle: -90 }} // label={{ value: label, position: "left", angle: -90 }}
/> />
<Tooltip <Tooltip
animationDuration={100} animationDuration={100}

View File

@@ -2,7 +2,6 @@ import { DailyStats } from "@/types/DailyStats";
import { LineChartArr, LineChartItem } from "@/types/LineChartStats"; import { LineChartArr, LineChartItem } from "@/types/LineChartStats";
const lineChartArr = (dailyStatsArr: DailyStats): LineChartArr => { const lineChartArr = (dailyStatsArr: DailyStats): LineChartArr => {
console.log(dailyStatsArr);
const lineChartArr = [] as LineChartArr; const lineChartArr = [] as LineChartArr;
if (dailyStatsArr.length) { if (dailyStatsArr.length) {
@@ -17,16 +16,14 @@ const lineChartArr = (dailyStatsArr: DailyStats): LineChartArr => {
const lineChartItem: LineChartItem = { const lineChartItem: LineChartItem = {
day, day,
"Links Deleted": linksDeleted, "Links Deleted": linksDeleted,
Commands: commandResponses, "Command Responses": commandResponses,
Triggers: timesTriggered "Times Triggered": timesTriggered
}; };
lineChartArr.push(lineChartItem); lineChartArr.push(lineChartItem);
}); });
} }
console.log(lineChartArr);
return lineChartArr; return lineChartArr;
}; };

View File

@@ -1,8 +1,8 @@
export interface LineChartItem { export interface LineChartItem {
day: number; day: number;
"Links Deleted": number; "Links Deleted": number;
Commands: number; "Command Responses": number;
Triggers: number; "Times Triggered": number;
} }
export type LineChartArr = LineChartItem[]; export type LineChartArr = LineChartItem[];