7
7
showLabelPropertyView ,
8
8
ColorControl ,
9
9
Dropdown ,
10
+ toArray ,
11
+ jsonControl ,
10
12
} from "lowcoder-sdk" ;
11
13
import { changeChildAction , CompAction } from "lowcoder-core" ;
12
14
import { BarSeriesOption } from "echarts" ;
@@ -25,6 +27,10 @@ const BarTypeOptions = [
25
27
label : trans ( "chart.waterfallBar" ) ,
26
28
value : "waterfall" ,
27
29
} ,
30
+ {
31
+ label : trans ( "chart.polar" ) ,
32
+ value : "polar" ,
33
+ } ,
28
34
] as const ;
29
35
30
36
export const BarChartConfig = ( function ( ) {
@@ -35,6 +41,10 @@ export const BarChartConfig = (function () {
35
41
barWidth : withDefault ( NumberControl , i18nObjs . defaultBarChartOption . barWidth ) ,
36
42
showBackground : BoolControl ,
37
43
backgroundColor : withDefault ( ColorControl , i18nObjs . defaultBarChartOption . barBg ) ,
44
+ radiusAxisMax : withDefault ( NumberControl , 4 ) ,
45
+ polarRadiusDeg : withDefault ( NumberControl , 30 ) ,
46
+ polarRadiusSize : withDefault ( NumberControl , 80 ) ,
47
+ labelData : jsonControl ( toArray , [ ] ) ,
38
48
} ,
39
49
( props ) : BarSeriesOption => {
40
50
const config : BarSeriesOption = {
@@ -48,6 +58,12 @@ export const BarChartConfig = (function () {
48
58
showBackground : props . showBackground ,
49
59
backgroundStyle : {
50
60
color : props . backgroundColor ,
61
+ } ,
62
+ polarData : {
63
+ radiusAxisMax : props . radiusAxisMax ,
64
+ polarRadiusDeg : props . polarRadiusDeg ,
65
+ polarRadiusSize : props . polarRadiusSize ,
66
+ labelData : props . labelData ,
51
67
}
52
68
53
69
} ;
@@ -58,6 +74,9 @@ export const BarChartConfig = (function () {
58
74
config . label = undefined ;
59
75
config . stack = "stackValue" ;
60
76
}
77
+ if ( props . type === "polar" ) {
78
+ config . coordinateSystem = 'polar' ;
79
+ }
61
80
return config ;
62
81
}
63
82
)
@@ -81,6 +100,18 @@ export const BarChartConfig = (function () {
81
100
{ children . showBackground . getView ( ) && children . backgroundColor . propertyView ( {
82
101
label : trans ( "barChart.bgColor" ) ,
83
102
} ) }
103
+ { children . type . getView ( ) === "polar" && children . radiusAxisMax . propertyView ( {
104
+ label : trans ( "barChart.radiusAxisMax" ) ,
105
+ } ) }
106
+ { children . type . getView ( ) === "polar" && children . polarRadiusDeg . propertyView ( {
107
+ label : trans ( "barChart.polarRadiusDeg" ) ,
108
+ } ) }
109
+ { children . type . getView ( ) === "polar" && children . polarRadiusSize . propertyView ( {
110
+ label : trans ( "barChart.polarRadiusSize" ) ,
111
+ } ) }
112
+ { children . type . getView ( ) === "polar" && children . labelData . propertyView ( {
113
+ label : trans ( "barChart.polarLabelData" ) ,
114
+ } ) }
84
115
</ >
85
116
) )
86
117
. build ( ) ;
0 commit comments