Skip to content

Commit baf77bb

Browse files
committed
item style
1 parent 63fa7f0 commit baf77bb

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,11 @@ export function getSeriesConfig(props: EchartsConfigProps) {
9191
...config,
9292
startAngle: s.startAngle,
9393
endAngle: s.endAngle,
94+
padAngle: s.padAngle,
9495
name: s.seriesName,
9596
label: {
9697
position: s.labelPosition,
9798
alignTo: s.labelAlignTo,
98-
bleedMargin: s.labelBleedMargin,
99-
edgeDistance: s.labelEdgeDistance,
10099
},
101100
labelLine: {
102101
length: s.labelLineLength,
@@ -106,6 +105,12 @@ export function getSeriesConfig(props: EchartsConfigProps) {
106105
itemName: props.xAxisKey,
107106
value: s.columnName,
108107
},
108+
itemStyle: {
109+
borderRadius: s.borderRadius,
110+
color: s.itemColor,
111+
shadowColor: s.itemShadowColor,
112+
shadowBlur: s.itemShadowBlur,
113+
},
109114
}
110115
if(s.roseType !== "none") {
111116
config.roseType = s.roseType;

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
BoolControl,
33
StringControl,
4+
ColorControl,
45
list,
56
dropdownControl,
67
withDefault,
@@ -90,6 +91,11 @@ const seriesChildrenMap = {
9091
labelEdgeDistance: withDefault(StringControl, '25%'),
9192
labelLineLength: withDefault(NumberControl, 10),
9293
labelLineLength2: withDefault(NumberControl, 10),
94+
padAngle: withDefault(NumberControl, 0),
95+
borderRadius: withDefault(NumberControl, 0),
96+
itemColor: ColorControl,
97+
itemShadowBlur: NumberControl,
98+
itemShadowColor: ColorControl,
9399
hide: BoolControl,
94100
// unique key, for sort
95101
dataIndex: valueComp<string>(""),
@@ -145,6 +151,21 @@ class SeriesComp extends SeriesTmpComp {
145151
{this.children.labelAlignTo.getView() === "labelLine" && this.children.labelLineLength2.propertyView({
146152
label: trans("pieChart.labelLineLength2"),
147153
})}
154+
{this.children.padAngle.propertyView({
155+
label: trans("pieChart.padAngle"),
156+
})}
157+
{this.children.borderRadius.propertyView({
158+
label: trans("pieChart.borderRadius"),
159+
})}
160+
{this.children.itemColor.propertyView({
161+
label: trans("pieChart.itemColor"),
162+
})}
163+
{this.children.itemShadowBlur.propertyView({
164+
label: trans("pieChart.itemShadowBlur"),
165+
})}
166+
{this.children.itemShadowColor.propertyView({
167+
label: trans("pieChart.itemShadowColor"),
168+
})}
148169
</>
149170
);
150171
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ export const en = {
348348
borderType: "Border Type",
349349
},
350350
pieChart: {
351+
itemColor: "Color",
352+
itemShadowColor: "Shadow Color",
353+
itemShadowBlur: "Shadow Blur",
354+
padAngle: "Pad Angle",
355+
borderRadius: "Border Radius",
351356
startAngle: "Start Angle",
352357
endAngle: "End Angle",
353358
roseType: "Rose Type",

0 commit comments

Comments
 (0)