diff --git a/components/layout/Economics/ChainBreakdown.tsx b/components/layout/Economics/ChainBreakdown.tsx index ed99bebc..2a8022f5 100644 --- a/components/layout/Economics/ChainBreakdown.tsx +++ b/components/layout/Economics/ChainBreakdown.tsx @@ -313,6 +313,23 @@ export default function ChainBreakdown({ }, [data, master]); //Get an array of potential data availabilities for this page + const maxRevenue = useMemo(() => { + let retValue = 0; + //Loop through for each chain + Object.keys(data).forEach((key) => { + const dataIndex = data[key][selectedTimespan].revenue.types.indexOf( + showUsd ? "usd" : "eth", + ); + + retValue = + data[key][selectedTimespan].revenue.total[dataIndex] > retValue + ? data[key][selectedTimespan].revenue.total[dataIndex] + : retValue; + }); + + return retValue; + }, [selectedTimespan, data, showUsd]); + function formatNumber(x: number) { return (
@@ -1057,12 +1074,12 @@ export default function ChainBreakdown({
-
+
- 0.01 - ? (312 * - data[item.key][selectedTimespan].revenue - .total[dataIndex]) / - totalRevenue - : `${ - (2200 * - data[item.key][selectedTimespan].revenue - .total[dataIndex]) / - totalRevenue - }%`, + width: `${ + (100 * + data[item.key][selectedTimespan].revenue + .total[dataIndex]) / + maxRevenue + }%`, + minWidth: data[item.key][selectedTimespan].revenue.total[ dataIndex