@@ -33,55 +33,61 @@ export function newSeries(name: string, columnName: string): SeriesDataType {
33
33
} ;
34
34
}
35
35
36
- export function newMarkLine ( type : string ) : MarkLineDataType {
37
- return {
38
- type,
39
- dataIndex : genRandomKey ( ) ,
40
- } ;
41
- }
42
-
43
- export const MarkLineTypeOptions = [
36
+ export const RoseTypeOptions = [
44
37
{
45
- label : trans ( "pieChart.max " ) ,
46
- value : "max " ,
38
+ label : trans ( "pieChart.radius " ) ,
39
+ value : "radius " ,
47
40
} ,
48
41
{
49
- label : trans ( "pieChart.average " ) ,
50
- value : "average " ,
42
+ label : trans ( "pieChart.area " ) ,
43
+ value : "area " ,
51
44
} ,
52
45
{
53
- label : trans ( "pieChart.min " ) ,
54
- value : "min " ,
46
+ label : trans ( "pieChart.none " ) ,
47
+ value : "none " ,
55
48
} ,
56
49
] as const ;
57
50
58
- export const RoseTypeOptions = [
51
+ export const LabelAlignToOptions = [
59
52
{
60
- label : trans ( "pieChart.radius " ) ,
61
- value : "radius " ,
53
+ label : trans ( "pieChart.none " ) ,
54
+ value : "none " ,
62
55
} ,
63
56
{
64
- label : trans ( "pieChart.area " ) ,
65
- value : "area " ,
57
+ label : trans ( "pieChart.labelLine " ) ,
58
+ value : "labelLine " ,
66
59
} ,
67
60
{
68
- label : trans ( "pieChart.none " ) ,
69
- value : "none " ,
61
+ label : trans ( "pieChart.edge " ) ,
62
+ value : "edge " ,
70
63
} ,
71
64
] as const ;
72
65
73
- export function newMarkArea ( ) : MarkLineDataType {
74
- return {
75
- dataIndex : genRandomKey ( ) ,
76
- } ;
77
- }
66
+ export const LabelPositionOptions = [
67
+ {
68
+ label : trans ( "pieChart.outer" ) ,
69
+ value : "outer" ,
70
+ } ,
71
+ {
72
+ label : trans ( "pieChart.inner" ) ,
73
+ value : "inner" ,
74
+ } ,
75
+ {
76
+ label : trans ( "pieChart.center" ) ,
77
+ value : "center" ,
78
+ } ,
79
+ ] as const ;
78
80
79
81
const seriesChildrenMap = {
80
82
columnName : StringControl ,
81
83
seriesName : StringControl ,
82
84
startAngle : withDefault ( NumberControl , 0 ) ,
83
85
endAngle : withDefault ( NumberControl , 360 ) ,
84
86
roseType : dropdownControl ( RoseTypeOptions , "none" ) ,
87
+ labelAlignTo : dropdownControl ( LabelAlignToOptions , "none" ) ,
88
+ labelPosition : dropdownControl ( LabelPositionOptions , "outer" ) ,
89
+ labelBleedMargin : withDefault ( NumberControl , 5 ) ,
90
+ labelEdgeDistance : withDefault ( StringControl , '25%' ) ,
85
91
hide : BoolControl ,
86
92
// unique key, for sort
87
93
dataIndex : valueComp < string > ( "" ) ,
@@ -119,6 +125,18 @@ class SeriesComp extends SeriesTmpComp {
119
125
{ this . children . roseType . propertyView ( {
120
126
label : trans ( "pieChart.roseType" ) ,
121
127
} ) }
128
+ { this . children . labelPosition . propertyView ( {
129
+ label : trans ( "pieChart.labelPosition" ) ,
130
+ } ) }
131
+ { this . children . labelAlignTo . propertyView ( {
132
+ label : trans ( "pieChart.labelAlignTo" ) ,
133
+ } ) }
134
+ { this . children . labelBleedMargin . propertyView ( {
135
+ label : trans ( "pieChart.labelBleedMargin" ) ,
136
+ } ) }
137
+ { this . children . labelEdgeDistance . propertyView ( {
138
+ label : trans ( "pieChart.labelEdgeDistance" ) ,
139
+ } ) }
122
140
</ >
123
141
) ;
124
142
}
0 commit comments