-
Fetching
+ Fetching {transactionPoints ? "" : "transactions"}{!transactionPoints && !userPrefs ? "," : ""} {userPrefs ? "" : "goals"}
>;
diff --git a/src/pages/dashboard/GraphUtils.ts b/src/pages/dashboard/GraphUtils.ts
index cad8f00..09edd4b 100644
--- a/src/pages/dashboard/GraphUtils.ts
+++ b/src/pages/dashboard/GraphUtils.ts
@@ -1,7 +1,7 @@
import {Transaction} from "../../utils/transaction.ts";
import strftime from "strftime";
-export type transactionPoint = { date: string; amount: number }
+type transactionPoint = { date: string; amount: number; goal: number }
export type finalGraphData = {raw: transactionPoint[], in: transactionPoint[], out: transactionPoint[]};
function cumulateTransactions(points: transactionPoint[]): transactionPoint[] {
@@ -33,7 +33,7 @@ function splitTransactions (data: transactionPoint[]): finalGraphData {
export function readTransactions(data: Transaction[]): finalGraphData {
return splitTransactions(
data.map((t) => {
- return {date: getDateString(t.dateTime), amount: t.amount}
+ return {date: getDateString(t.dateTime), amount: t.amount, goal: 800};
})
);
}
\ No newline at end of file
diff --git a/src/pages/dashboard/Graphs.tsx b/src/pages/dashboard/Graphs.tsx
index ebd2a4f..098d6c8 100644
--- a/src/pages/dashboard/Graphs.tsx
+++ b/src/pages/dashboard/Graphs.tsx
@@ -1,6 +1,3 @@
-import {Line, LineChart, ResponsiveContainer, XAxis, YAxis} from "recharts";
-
-type transactionPoint = { date: string; amount: number; goal: number }
import {Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis} from "recharts";
import {transactionPoint} from "./GraphUtils.ts";