@@ -22,7 +22,6 @@ import {
22
22
import type { Lang } from "@/lib/types"
23
23
24
24
import { wrapLabel } from "@/lib/utils/charts"
25
- import { isMobile } from "@/lib/utils/isMobile"
26
25
import { isLangRightToLeft } from "@/lib/utils/translations"
27
26
28
27
// ChartDataLabels required to display y-labels on top of bars
@@ -176,23 +175,9 @@ const EnergyConsumptionChart = () => {
176
175
} as any , // casted to avoid TS issue,
177
176
color : useColorModeValue ( "#333333" , "#F2F2F2" ) ,
178
177
} ,
179
- // bottom legend styles
178
+ // legend styles
180
179
legend : {
181
- display : false ,
182
- position : "bottom" as any , // casted to avoid TS issue
183
- align : "center" as any , // casted to avoid TS issue
184
- labels : {
185
- textAlign : "center" as any , // casted to avoid TS issue
186
- font : {
187
- weight : "bold" ,
188
- size : "16px" ,
189
- } as any , // casted to avoid TS issue
190
- color : useColorModeValue ( "#333333" , "#F2F2F2" ) ,
191
- boxWidth : 0 ,
192
- boxHeight : 40 ,
193
- } ,
194
- rtl : isRtl ,
195
- onClick : ( ) => null , // disable onClick data visibility
180
+ display : false , // hide chart top legend
196
181
} ,
197
182
title : {
198
183
display : false , // hide chart title
@@ -228,22 +213,11 @@ const EnergyConsumptionChart = () => {
228
213
} ,
229
214
}
230
215
231
- // chart custom legend
232
- const chartLegend = wrapLabel (
233
- t ( "page-what-is-ethereum-energy-consumption-chart-legend" ) ,
234
- isMobile ( )
235
- ? { width : 30 }
236
- : {
237
- width : t ( "page-what-is-ethereum-energy-consumption-chart-legend" )
238
- . length ,
239
- }
240
- )
241
-
242
216
const chartData = {
243
217
labels : rawData ?. map ( ( item ) => wrapLabel ( item . name ) ) ,
244
218
datasets : [
245
219
{
246
- label : chartLegend as any , // casted to avoid TS issue
220
+ label : undefined , // don't remove, needs some value provided to render properly
247
221
data : rawData ?. map ( ( item ) => item . amount ) || [ ] ,
248
222
} ,
249
223
] ,
0 commit comments