@@ -5,7 +5,7 @@ import { enrichEventWithDetails, ThemingParameters } from '@ui5/webcomponents-re
55import type { CSSProperties } from 'react' ;
66import { forwardRef } from 'react' ;
77import { PolarAngleAxis , RadialBar , RadialBarChart } from 'recharts' ;
8- import { useOnClickInternal } from '../../hooks/useOnClickInternal .js' ;
8+ import type { CategoricalChartFunc } from 'recharts/types/chart/types .js' ;
99import type { IChartBaseProps } from '../../interfaces/IChartBaseProps.js' ;
1010import { ChartContainer } from '../../internal/ChartContainer.js' ;
1111import { PieChartPlaceholder } from '../PieChart/Placeholder.js' ;
@@ -18,6 +18,7 @@ interface RadialChartConfig {
1818
1919 [ rest : string ] : any ;
2020}
21+
2122export interface RadialChartProps
2223 extends Omit < CommonProps , 'onClick' | 'children' | 'onLegendClick' > ,
2324 Pick < IChartBaseProps , 'loading' | 'loadingDelay' > {
@@ -57,7 +58,7 @@ export interface RadialChartProps
5758 */
5859 onClick ?: (
5960 event : CustomEvent < {
60- // todo: map new values to old ones to prevent breaking changes
61+ // todo: remove payload and activePayloads in next major?
6162 payload : unknown ;
6263 activePayloads : Record < string , unknown > [ ] ;
6364 dataIndex : number ;
@@ -127,7 +128,15 @@ const RadialChart = forwardRef<HTMLDivElement, RadialChartProps>((props, ref) =>
127128 }
128129 } ;
129130
130- const onClickInternal = useOnClickInternal ( onClick ) ;
131+ const handleOnClick : CategoricalChartFunc = ( _ , e ) => {
132+ onClick (
133+ // @ts -expect-error: enrichEventWithDetails expects a CustomEvent
134+ enrichEventWithDetails ( e , {
135+ // @ts -expect-error: detail property exists
136+ activePayloads : [ e . detail . payload ] ,
137+ } ) ,
138+ ) ;
139+ } ;
131140
132141 return (
133142 < ChartContainer
@@ -143,7 +152,7 @@ const RadialChart = forwardRef<HTMLDivElement, RadialChartProps>((props, ref) =>
143152 { ...rest }
144153 >
145154 < RadialBarChart
146- onClick = { onClickInternal }
155+ onClick = { handleOnClick }
147156 innerRadius = "90%"
148157 outerRadius = "100%"
149158 barSize = { 10 }
@@ -168,8 +177,9 @@ const RadialChart = forwardRef<HTMLDivElement, RadialChartProps>((props, ref) =>
168177 y = "50%"
169178 textAnchor = "middle"
170179 dominantBaseline = "middle"
171- className = "progress-label"
172- style = { { ...defaultDisplayValueStyles , ...displayValueStyle } }
180+ //todo: why do we need this?
181+ // className="progress-label"
182+ style = { displayValueStyle }
173183 >
174184 { displayValue }
175185 </ text >
0 commit comments