Skip to content

Commit 71c01ba

Browse files
committed
pie bg image
1 parent baf77bb commit 71c01ba

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ export function getSeriesConfig(props: EchartsConfigProps) {
115115
if(s.roseType !== "none") {
116116
config.roseType = s.roseType;
117117
}
118+
if(s.itemBg) {
119+
config.itemStyle = {
120+
color: {
121+
image: s.itemBg,
122+
repeat: 'repeat',
123+
}
124+
}
125+
}
118126
} else {
119127
config.data = s.data;
120128
config.center = s.date;

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
MultiCompBuilder,
1313
valueComp,
1414
} from "lowcoder-sdk";
15-
import { trans } from "i18n/comps";
15+
import { i18nObjs, trans } from "i18n/comps";
1616

1717
import { ConstructorToComp, ConstructorToDataType, ConstructorToView } from "lowcoder-core";
1818
import { CompAction, CustomAction, customAction, isMyCustomAction } from "lowcoder-core";
@@ -94,6 +94,7 @@ const seriesChildrenMap = {
9494
padAngle: withDefault(NumberControl, 0),
9595
borderRadius: withDefault(NumberControl, 0),
9696
itemColor: ColorControl,
97+
itemBg: StringControl,
9798
itemShadowBlur: NumberControl,
9899
itemShadowColor: ColorControl,
99100
hide: BoolControl,
@@ -166,6 +167,10 @@ class SeriesComp extends SeriesTmpComp {
166167
{this.children.itemShadowColor.propertyView({
167168
label: trans("pieChart.itemShadowColor"),
168169
})}
170+
{this.children.itemBg.propertyView({
171+
label: trans("pieChart.itemBg"),
172+
placeholder: i18nObjs.defaultPieBg,
173+
})}
169174
</>
170175
);
171176
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ export const en = {
348348
borderType: "Border Type",
349349
},
350350
pieChart: {
351+
itemBg: "Background Image",
351352
itemColor: "Color",
352353
itemShadowColor: "Shadow Color",
353354
itemShadowBlur: "Shadow Blur",

‎client/packages/lowcoder-comps/src/i18n/comps/locales/enObj.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -561,4 +561,5 @@ export const enObj: I18nObjects = {
561561
},
562562

563563
defaultMapJsonOption: defaultMapData,
564+
defaultPieBg: 'data:image/jpeg;base64,/9j/4AAQS...',
564565
};

‎client/packages/lowcoder-comps/src/i18n/comps/locales/types.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ export type I18nObjects = {
2727
defaultMapJsonOption: Record<string, unknown>;
2828
timeXAxisLabel?: XAXisComponentOption["axisLabel"];
2929
imageEditorLocale?: Record<string, string>;
30+
defaultPieBg: string;
3031
};

0 commit comments

Comments
 (0)