diff --git a/src/components/pages/home/MainChart.tsx b/src/components/pages/home/MainChart.tsx index 81afdea..1fcc0c0 100644 --- a/src/components/pages/home/MainChart.tsx +++ b/src/components/pages/home/MainChart.tsx @@ -1,4 +1,5 @@ import CustomTooltip from "@/components/CustomTooltip"; +import { MAIN_CHART_DATA_MAX } from "@/constants"; import { useMainChartData, useValidatorsWithStatsQuery } from "@/hooks"; import { toggleSelectedMoniker, useHomeStore } from "@/store/home"; import clsx from "clsx"; @@ -44,6 +45,13 @@ export const MainChart = () => { ); } + const points = chartData + const lastPoint = points[points.length - 1] + + const largestDatapoint = Math.max(...Object.entries(lastPoint).map( + ([key, value]) => key === "key" ? 0 : value + ), MAIN_CHART_DATA_MAX) + return ( @@ -62,6 +70,7 @@ export const MainChart = () => { />