import { t } from "@lingui/macro"; import { abilityPoints } from "lib/lists/abilityPoints"; import { useMyTheme } from "lib/useMyTheme"; import React from "react"; import { CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; interface StatChartProps { title: string; getEffect: (ap: number) => number; ap: number; otherAp?: number; startChartsAtZero: boolean; } const StatChart: React.FC = ({ title, ap, otherAp, getEffect, startChartsAtZero, }) => { const { themeColorHex, secondaryBgColor } = useMyTheme(); const getData = () => abilityPoints.map((ap) => ({ name: `${ap}AP`, [title]: getEffect(ap) })); const CustomizedDot = (props: any) => { const { cx, cy, payload } = props; if (payload.name === `${ap}${t`AP`}`) { return ( ); } if (payload.name === `${otherAp}${t`AP`}`) { return ( ); } return null; }; return ( } isAnimationActive={false} /> ); }; export default StatChart;