diff --git a/src/client/components/chart-cards/common/chart/index.tsx b/src/client/components/chart-cards/common/chart/index.tsx index 466e020..db967c5 100644 --- a/src/client/components/chart-cards/common/chart/index.tsx +++ b/src/client/components/chart-cards/common/chart/index.tsx @@ -46,7 +46,7 @@ export const CanvasChart = ({ total, hueOffset = 0, domain, hardDomain, data, fo // Record data changes useEffect(() => { if (data) { - while (xFromTimestamp(history.current[0][0], width) < -xMargin) { + while (history.current.length && xFromTimestamp(history.current[0][0], width) < -xMargin) { history.current.shift(); }