Skip to content

Commit c40b5e0

Browse files
committed
Fix chart styling issues
1 parent 7e2a708 commit c40b5e0

File tree

5 files changed

+24
-19
lines changed

5 files changed

+24
-19
lines changed

client/packages/lowcoder-comps/src/comps/boxplotChartComp/boxplotChartPropertyView.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ export function boxplotChartPropertyView(
7373
<Section name={sectionNames.yAxisStyle}>
7474
{children.yAxisStyle?.getPropertyView()}
7575
</Section>
76-
<Section name={sectionNames.legendStyle}>
77-
{children.legendStyle?.getPropertyView()}
78-
</Section>
7976
<Section name={sectionNames.advanced}>
8077
{children.data.propertyView({
8178
label: trans("chart.data"),

client/packages/lowcoder-comps/src/comps/boxplotChartComp/boxplotChartUtils.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,16 @@ export function getEchartsConfig(
159159
name: props.xAxisKey,
160160
nameLocation: 'middle',
161161
nameGap: 30,
162-
scale: true
162+
scale: true,
163+
axisLabel: {
164+
...styleWrapper(props?.xAxisStyle, theme?.xAxisStyle, 11)
165+
}
163166
},
164167
yAxis: {
165168
type: "category",
169+
axisLabel: {
170+
...styleWrapper(props?.yAxisStyle, theme?.yAxisStyle, 11)
171+
}
166172
},
167173
dataset: [
168174
{
@@ -209,22 +215,24 @@ export function getEchartsConfig(
209215
config = {
210216
...config,
211217
series: [{
212-
name: 'boxplot',
218+
name: props.xAxisKey,
213219
type: 'boxplot',
214220
datasetId: 'finaldataset',
215-
itemStyle: {
216-
color: '#b8c5f2'
217-
},
218221
encode: {
219222
x: ['min', 'Q1', 'median', 'Q3', 'max'],
220223
y: props.yAxisKey,
221224
itemName: [props.yAxisKey],
222225
tooltip: ['min', 'Q1', 'median', 'Q3', 'max']
223-
}
226+
},
227+
itemStyle: {
228+
color: '#b8c5f2',
229+
...chartStyleWrapper(props?.chartStyle, theme?.chartStyle)
230+
},
224231
}],
225232
};
233+
if(config.series[0].itemStyle.borderWidth === 0) config.series[0].itemStyle.borderWidth = 1;
226234

227-
console.log("Echarts transformedData and config", transformedData, config);
235+
// console.log("Echarts transformedData and config", transformedData, config);
228236
return config;
229237
}
230238

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@ export function pieChartPropertyView(
119119
<Section name={sectionNames.titleStyle}>
120120
{children.titleStyle?.getPropertyView()}
121121
</Section>
122-
<Section name={sectionNames.xAxisStyle}>
123-
{children.xAxisStyle?.getPropertyView()}
124-
</Section>
125-
<Section name={sectionNames.yAxisStyle}>
126-
{children.yAxisStyle?.getPropertyView()}
127-
</Section>
128122
<Section name={sectionNames.legendStyle}>
129123
{children.legendStyle?.getPropertyView()}
130124
</Section>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export function getSeriesConfig(props: EchartsConfigProps) {
128128
}
129129
}
130130
}
131-
config.radius = s.radius;
131+
if(props.chartConfig.subtype !== "doughnutPie") config.radius = s.radius;
132132
if(s.left!="" && s.top!="") {
133133
config.center = [s.left, s.top];
134134
}
@@ -252,7 +252,7 @@ export function getEchartsConfig(
252252
},
253253
itemStyle: {
254254
...series.itemStyle,
255-
// ...chartStyleWrapper(props?.chartStyle, theme?.chartStyle)
255+
...chartStyleWrapper(props?.chartStyle, theme?.chartStyle)
256256
},
257257
lineStyle: {
258258
...chartStyleWrapper(props?.chartStyle, theme?.chartStyle)

client/packages/lowcoder-comps/src/comps/scatterChartComp/scatterChartUtils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,16 @@ export function getEchartsConfig(
187187
},
188188
axisLine: {
189189
show: props.chartConfig.boundaryGap,
190+
},
191+
axisLabel: {
192+
...styleWrapper(props?.xAxisStyle, theme?.xAxisStyle, 11)
190193
}
191194
},
192195
yAxis: {
193196
type: "category",
197+
axisLabel: {
198+
...styleWrapper(props?.yAxisStyle, theme?.yAxisStyle, 11)
199+
}
194200
},
195201
};
196202

@@ -222,7 +228,7 @@ export function getEchartsConfig(
222228
...series,
223229
itemStyle: {
224230
...series.itemStyle,
225-
// ...chartStyleWrapper(props?.chartStyle, theme?.chartStyle)
231+
...chartStyleWrapper(props?.chartStyle, theme?.chartStyle)
226232
},
227233
lineStyle: {
228234
...chartStyleWrapper(props?.chartStyle, theme?.chartStyle)

0 commit comments

Comments
 (0)