import React from "react"; import { Line } from "react-chartjs-2"; import { Chart, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, } from "chart.js"; import styles from "./Graph.module.sass"; export default function Graph(props) { Chart.register( CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend ); const accounts = [ ...new Set( props.transactions .map((txn) => { return txn.parts.map((part) => { return part.account; }); }) .flat() ), ]; return (