Changed Chart Labels
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import { LineChartArr } from "@/types/LineChartStats";
|
||||
|
||||
interface LineChartComponentProps {
|
||||
label: "Triggers" | "Links Deleted" | "Commands";
|
||||
label: "Times Triggered" | "Links Deleted" | "Command Responses";
|
||||
data: LineChartArr;
|
||||
}
|
||||
|
||||
@@ -32,14 +32,14 @@ const LineChartComponent = ({
|
||||
// axisLine={false}
|
||||
dataKey={chart.key("day")}
|
||||
stroke={chart.color("border")}
|
||||
label={{ value: "Day", position: "bottom" }}
|
||||
// label={{ value: "Day", position: "bottom" }}
|
||||
/>
|
||||
<YAxis
|
||||
// axisLine={false}
|
||||
tickLine={false}
|
||||
tickMargin={10}
|
||||
stroke={chart.color("border")}
|
||||
label={{ value: label, position: "left", angle: -90 }}
|
||||
// label={{ value: label, position: "left", angle: -90 }}
|
||||
/>
|
||||
<Tooltip
|
||||
animationDuration={100}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { DailyStats } from "@/types/DailyStats";
|
||||
import { LineChartArr, LineChartItem } from "@/types/LineChartStats";
|
||||
|
||||
const lineChartArr = (dailyStatsArr: DailyStats): LineChartArr => {
|
||||
console.log(dailyStatsArr);
|
||||
const lineChartArr = [] as LineChartArr;
|
||||
|
||||
if (dailyStatsArr.length) {
|
||||
@@ -17,16 +16,14 @@ const lineChartArr = (dailyStatsArr: DailyStats): LineChartArr => {
|
||||
const lineChartItem: LineChartItem = {
|
||||
day,
|
||||
"Links Deleted": linksDeleted,
|
||||
Commands: commandResponses,
|
||||
Triggers: timesTriggered
|
||||
"Command Responses": commandResponses,
|
||||
"Times Triggered": timesTriggered
|
||||
};
|
||||
|
||||
lineChartArr.push(lineChartItem);
|
||||
});
|
||||
}
|
||||
|
||||
console.log(lineChartArr);
|
||||
|
||||
return lineChartArr;
|
||||
};
|
||||
|
||||
|
||||
4
src/types/LineChartStats.d.ts
vendored
4
src/types/LineChartStats.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
export interface LineChartItem {
|
||||
day: number;
|
||||
"Links Deleted": number;
|
||||
Commands: number;
|
||||
Triggers: number;
|
||||
"Command Responses": number;
|
||||
"Times Triggered": number;
|
||||
}
|
||||
|
||||
export type LineChartArr = LineChartItem[];
|
||||
|
||||
Reference in New Issue
Block a user