@@ -33,55 +33,61 @@ export function newSeries(name: string, columnName: string): SeriesDataType {
3333 } ;
3434}
3535
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 = [
4437 {
45- label : trans ( "pieChart.max " ) ,
46- value : "max " ,
38+ label : trans ( "pieChart.radius " ) ,
39+ value : "radius " ,
4740 } ,
4841 {
49- label : trans ( "pieChart.average " ) ,
50- value : "average " ,
42+ label : trans ( "pieChart.area " ) ,
43+ value : "area " ,
5144 } ,
5245 {
53- label : trans ( "pieChart.min " ) ,
54- value : "min " ,
46+ label : trans ( "pieChart.none " ) ,
47+ value : "none " ,
5548 } ,
5649] as const ;
5750
58- export const RoseTypeOptions = [
51+ export const LabelAlignToOptions = [
5952 {
60- label : trans ( "pieChart.radius " ) ,
61- value : "radius " ,
53+ label : trans ( "pieChart.none " ) ,
54+ value : "none " ,
6255 } ,
6356 {
64- label : trans ( "pieChart.area " ) ,
65- value : "area " ,
57+ label : trans ( "pieChart.labelLine " ) ,
58+ value : "labelLine " ,
6659 } ,
6760 {
68- label : trans ( "pieChart.none " ) ,
69- value : "none " ,
61+ label : trans ( "pieChart.edge " ) ,
62+ value : "edge " ,
7063 } ,
7164] as const ;
7265
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 ;
7880
7981const seriesChildrenMap = {
8082 columnName : StringControl ,
8183 seriesName : StringControl ,
8284 startAngle : withDefault ( NumberControl , 0 ) ,
8385 endAngle : withDefault ( NumberControl , 360 ) ,
8486 roseType : dropdownControl ( RoseTypeOptions , "none" ) ,
87+ labelAlignTo : dropdownControl ( LabelAlignToOptions , "none" ) ,
88+ labelPosition : dropdownControl ( LabelPositionOptions , "outer" ) ,
89+ labelBleedMargin : withDefault ( NumberControl , 5 ) ,
90+ labelEdgeDistance : withDefault ( StringControl , '25%' ) ,
8591 hide : BoolControl ,
8692 // unique key, for sort
8793 dataIndex : valueComp < string > ( "" ) ,
@@ -119,6 +125,18 @@ class SeriesComp extends SeriesTmpComp {
119125 { this . children . roseType . propertyView ( {
120126 label : trans ( "pieChart.roseType" ) ,
121127 } ) }
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+ } ) }
122140 </ >
123141 ) ;
124142 }
0 commit comments