Skip to content

Commit 1532e53

Browse files
committed
chore: use Text wrapper for energy chart legend
1 parent 1597a33 commit 1532e53

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/components/EnergyConsumptionChart.tsx

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Bar } from "react-chartjs-2"
1414
import {
1515
Box,
1616
Center,
17+
Text,
1718
useBreakpointValue,
1819
useColorModeValue,
1920
} from "@chakra-ui/react"
@@ -177,7 +178,7 @@ const EnergyConsumptionChart = () => {
177178
},
178179
// bottom legend styles
179180
legend: {
180-
display: true,
181+
display: false,
181182
position: "bottom" as any, // casted to avoid TS issue
182183
align: "center" as any, // casted to avoid TS issue
183184
labels: {
@@ -249,19 +250,25 @@ const EnergyConsumptionChart = () => {
249250
} satisfies ChartData
250251

251252
return (
252-
<Center w="full">
253-
<Box
254-
position="relative"
255-
maxW="500px"
256-
m="auto"
257-
w="80vw"
258-
h="500px"
259-
mb={{ base: 4, md: 0 }}
260-
>
261-
{/* TODO: isRtl ? data?.reverse() : data */}
262-
<Bar options={chartOptions} data={chartData} updateMode="none" />
263-
</Box>
264-
</Center>
253+
<Box mb={16}>
254+
<Center w="full" mb={{ base: 4, md: 6 }}>
255+
<Box
256+
position="relative"
257+
maxW="500px"
258+
m="auto"
259+
w="80vw"
260+
h="500px"
261+
mb={{ base: 4, md: 0 }}
262+
>
263+
{/* TODO: isRtl ? data?.reverse() : data */}
264+
<Bar options={chartOptions} data={chartData} updateMode="none" />
265+
</Box>
266+
</Center>
267+
268+
<Text fontWeight="semibold" textAlign="center">
269+
{t("page-what-is-ethereum-energy-consumption-chart-legend")}
270+
</Text>
271+
</Box>
265272
)
266273
}
267274

0 commit comments

Comments
 (0)