@@ -17,7 +17,6 @@ import {
1717 YAxis ,
1818} from 'recharts' ;
1919import type { YAxisProps } from 'recharts' ;
20- import { getValueByDataKey } from 'recharts/lib/util/ChartUtils.js' ;
2120import { useCancelAnimationFallback } from '../../hooks/useCancelAnimationFallback.js' ;
2221import { useChartMargin } from '../../hooks/useChartMargin.js' ;
2322import { useLabelFormatter } from '../../hooks/useLabelFormatter.js' ;
@@ -48,12 +47,6 @@ const measureDefaults = {
4847 opacity : 1 ,
4948} ;
5049
51- const valueAccessor =
52- ( attribute ) =>
53- ( { payload } ) => {
54- return getValueByDataKey ( payload , attribute ) ;
55- } ;
56-
5750interface MeasureConfig extends IChartMeasure {
5851 /**
5952 * Bar Width
@@ -284,8 +277,6 @@ const BarChart = forwardRef<HTMLDivElement, BarChartProps>((props, ref) => {
284277 tickLine = { {
285278 stroke : chartConfig . secondYAxis . color ?? `var(--sapChart_OrderedColor_${ ( colorSecondY % 12 ) + 1 } )` ,
286279 } }
287- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
288- // @ts -ignore
289280 label = { { value : chartConfig . secondYAxis . name , offset : 2 , angle : + 90 , position : 'center' } }
290281 orientation = "top"
291282 interval = { 0 }
@@ -328,16 +319,13 @@ const BarChart = forwardRef<HTMLDivElement, BarChartProps>((props, ref) => {
328319 fill = { element . color ?? `var(--sapChart_OrderedColor_${ ( index % 12 ) + 1 } )` }
329320 stroke = { element . color ?? `var(--sapChart_OrderedColor_${ ( index % 12 ) + 1 } )` }
330321 barSize = { element . width }
331- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
332- // @ts -ignore
333322 onClick = { onDataPointClickInternal }
334323 isAnimationActive = { ! noAnimation }
335324 onAnimationStart = { handleBarAnimationStart }
336325 onAnimationEnd = { handleBarAnimationEnd }
337326 >
338327 < LabelList
339- data = { dataset }
340- valueAccessor = { valueAccessor ( element . accessor ) }
328+ dataKey = { element . accessor }
341329 content = { < ChartDataLabel config = { element } chartType = "bar" position = { 'insideRight' } /> }
342330 />
343331 { dataset . map ( ( data , i ) => {
@@ -353,8 +341,6 @@ const BarChart = forwardRef<HTMLDivElement, BarChartProps>((props, ref) => {
353341 ) ;
354342 } ) }
355343 { ! noLegend && (
356- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
357- // @ts -ignore
358344 < Legend
359345 verticalAlign = { chartConfig . legendPosition }
360346 align = { chartConfig . legendHorizontalAlign }
@@ -371,7 +357,6 @@ const BarChart = forwardRef<HTMLDivElement, BarChartProps>((props, ref) => {
371357 label = { referenceLine ?. label }
372358 />
373359 ) }
374- { /*ToDo: remove conditional rendering once `active` is working again (https://github.com/recharts/recharts/issues/2703)*/ }
375360 { tooltipConfig ?. active !== false && (
376361 < Tooltip
377362 cursor = { tooltipFillOpacity }
0 commit comments