Skip to content

Commit 8735112

Browse files
committed
color and data updated
1 parent 3421f8c commit 8735112

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

client/packages/lowcoder-comps/src/comps/chartComp/chartUtils.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,13 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
137137
"left":"center"
138138
},
139139
"backgroundColor": props?.style?.background,
140-
"color":props?.style?.color,
140+
"color": props.echartsOption.data?.map(data => data.color),
141141
"tooltip": props.tooltip&&{
142142
"trigger": "item",
143143
"formatter": "{a} <br/>{b} : {c}%"
144144
},
145145
"legend":props.legendVisibility&& {
146-
"data": [
147-
"Show",
148-
"Click",
149-
"Visit",
150-
"Query",
151-
"Buy"
152-
],
146+
"data": props.echartsOption.data?.map(data=>data.name),
153147
"top": props.echartsLegendConfig.top,
154148
},
155149
"series": [
@@ -167,7 +161,7 @@ export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSiz
167161
"show": true,
168162
"position": props.echartsLabelConfig.top
169163
},
170-
"data": props.echartsOption.series[0].data
164+
"data": props.echartsOption.data
171165
}
172166
]
173167
}

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,13 @@ export const enObj: I18nObjects = {
154154
],
155155

156156
defaultEchartsJsonOption: {
157-
series: [
158-
{
159-
data: [
160-
{ value: 100, name: "Show" },
161-
{ value: 80, name: "Click" },
162-
{ value: 60, name: "Visit" },
163-
{ value: 40, name: "Query" },
164-
{ value: 20, name: "Buy" },
157+
data: [
158+
{ value: 100, name: "Show",color:'#fc8452' },
159+
{ value: 80, name: "Click" ,color:'#9a60b4'},
160+
{ value: 60, name: "Visit" ,color:'#fac858'},
161+
{ value: 40, name: "Query" ,color:'#ee6666'},
162+
{ value: 20, name: "Buy" ,color:'#3ba272'},
165163
],
166-
},
167-
],
168164
},
169165

170166
defaultMapJsonOption: defaultMapData,

0 commit comments

Comments
 (0)