Skip to content

Commit 7644006

Browse files
committed
label line property
1 parent bedbbc1 commit 7644006

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

client/packages/lowcoder-comps/src/comps/pieChartComp/pieChartUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export function getSeriesConfig(props: EchartsConfigProps) {
8383
bleedMargin: s.getView().labelBleedMargin,
8484
edgeDistance: s.getView().labelEdgeDistance,
8585
},
86+
labelLine: {
87+
length: s.getView().labelLineLength,
88+
length2: s.getView().labelLineLength2,
89+
},
8690
encode: {
8791
itemName: props.xAxisKey,
8892
value: s.getView().columnName,

client/packages/lowcoder-comps/src/comps/pieChartComp/seriesComp.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ const seriesChildrenMap = {
8888
labelPosition: dropdownControl(LabelPositionOptions, "outer"),
8989
labelBleedMargin: withDefault(NumberControl, 5),
9090
labelEdgeDistance: withDefault(StringControl, '25%'),
91+
labelLineLength: withDefault(NumberControl, 10),
92+
labelLineLength2: withDefault(NumberControl, 10),
9193
hide: BoolControl,
9294
// unique key, for sort
9395
dataIndex: valueComp<string>(""),
@@ -134,9 +136,15 @@ class SeriesComp extends SeriesTmpComp {
134136
{this.children.labelBleedMargin.propertyView({
135137
label: trans("pieChart.labelBleedMargin"),
136138
})}
137-
{this.children.labelEdgeDistance.propertyView({
139+
{this.children.labelAlignTo.getView() === "edge" && this.children.labelEdgeDistance.propertyView({
138140
label: trans("pieChart.labelEdgeDistance"),
139141
})}
142+
{this.children.labelLineLength.propertyView({
143+
label: trans("pieChart.labelLineLength"),
144+
})}
145+
{this.children.labelAlignTo.getView() === "labelLine" && this.children.labelLineLength2.propertyView({
146+
label: trans("pieChart.labelLineLength2"),
147+
})}
140148
</>
141149
);
142150
}

client/packages/lowcoder-comps/src/i18n/comps/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ export const en = {
363363
inside: "Inside",
364364
inner: "Inner",
365365
center: "Center",
366+
labelLineLength: "Label Line Length",
367+
labelLineLength2: "Label Line Length2",
366368
},
367369
barChart: {
368370
title: 'Title',

0 commit comments

Comments
 (0)