@@ -4,7 +4,7 @@ import { ChartContainer } from '@ui5/webcomponents-react-charts/lib/next/ChartCo
4
4
import { PieChartPlaceholder } from '@ui5/webcomponents-react-charts/lib/PieChartPlaceholder' ;
5
5
import { CommonProps } from '@ui5/webcomponents-react/interfaces/CommonProps' ;
6
6
import React , { CSSProperties , FC , forwardRef , Ref , useCallback , useMemo } from 'react' ;
7
- import { PolarAngleAxis , RadialBar , RadialBarChart as RadialBarChartLib } from 'recharts' ;
7
+ import { PolarAngleAxis , RadialBar , RadialBarChart } from 'recharts' ;
8
8
9
9
export interface RadialChartProps extends CommonProps {
10
10
value ?: number ;
@@ -14,6 +14,10 @@ export interface RadialChartProps extends CommonProps {
14
14
onDataPointClick ?: ( event : CustomEvent < { value : unknown ; payload : unknown ; dataIndex : number } > ) => void ;
15
15
}
16
16
17
+ const radialChartMargin = { right : 30 , left : 30 , top : 30 , bottom : 30 } ;
18
+ const radialBarBackground = { fill : ThemingParameters . sapContent_ImagePlaceholderBackground } ;
19
+ const radialBarLabelStyle = { fontSize : ThemingParameters . sapFontHeader3Size , fill : ThemingParameters . sapTextColor } ;
20
+
17
21
/**
18
22
* <code>import { RadialChart } from '@ui5/webcomponents-react-charts/lib/next/RadialChart';</code>
19
23
* **This component is under active development. The API is not stable yet and might change without further notice.**
@@ -52,8 +56,8 @@ const RadialChart: FC<RadialChartProps> = forwardRef((props: RadialChartProps, r
52
56
tooltip = { tooltip }
53
57
slot = { slot }
54
58
>
55
- < RadialBarChartLib
56
- margin = { { right : 30 , left : 30 , top : 30 , bottom : 30 } }
59
+ < RadialBarChart
60
+ margin = { radialChartMargin }
57
61
innerRadius = "90%"
58
62
outerRadius = "100%"
59
63
barSize = { 10 }
@@ -65,7 +69,7 @@ const RadialChart: FC<RadialChartProps> = forwardRef((props: RadialChartProps, r
65
69
>
66
70
< PolarAngleAxis type = "number" domain = { range } tick = { false } />
67
71
< RadialBar
68
- background = { { fill : ThemingParameters . sapContent_ImagePlaceholderBackground } }
72
+ background = { radialBarBackground }
69
73
dataKey = "value"
70
74
cornerRadius = "50%"
71
75
fill = { color ?? `var(--sapChart_OrderedColor_${ ( 0 % 12 ) + 1 } )` }
@@ -77,11 +81,11 @@ const RadialChart: FC<RadialChartProps> = forwardRef((props: RadialChartProps, r
77
81
textAnchor = "middle"
78
82
dominantBaseline = "middle"
79
83
className = "progress-label"
80
- style = { { fontSize : ThemingParameters . sapFontHeader3Size , fill : ThemingParameters . sapTextColor } }
84
+ style = { radialBarLabelStyle }
81
85
>
82
86
{ displayValue }
83
87
</ text >
84
- </ RadialBarChartLib >
88
+ </ RadialBarChart >
85
89
</ ChartContainer >
86
90
) ;
87
91
} ) ;
0 commit comments