diff --git a/src/client/components/chart-cards/common/chart/index.tsx b/src/client/components/chart-cards/common/chart/index.tsx index 5a870cf..26468e8 100644 --- a/src/client/components/chart-cards/common/chart/index.tsx +++ b/src/client/components/chart-cards/common/chart/index.tsx @@ -112,7 +112,7 @@ export const CanvasChart = ({ total, hueOffset = 0, domain, hardDomain, dataKey, ctx.lineTo(x, y); } - ctx.lineTo(width + xMargin, height - (height * (history.current.data[0][dataKey][i] ?? 0)) / max.current); + ctx.lineTo(width + xMargin, height - (height * (history.current.data.at(-1)?.[dataKey][i] ?? 0)) / max.current); ctx.lineTo(width + xMargin, height); if (type === 'fill') ctx.fill();