Skip to content

Commit 4aa934b

Browse files
committed
Polar chart
1 parent b31ed15 commit 4aa934b

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

client/packages/lowcoder-comps/src/comps/basicChartComp/chartConfigs/scatterChartConfig.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const ScatterChartConfig = (function () {
5151
visualMapDimension: NumberControl,
5252
visualMapColorMin: ColorControl,
5353
visualMapColorMax: ColorControl,
54+
polar: BoolControl,
5455
},
5556
(props): ScatterSeriesOption => {
5657
return {
@@ -85,7 +86,8 @@ export const ScatterChartConfig = (function () {
8586
visualMapDimension: props.visualMapDimension,
8687
visualMapColorMin: props.visualMapColorMin,
8788
visualMapColorMax: props.visualMapColorMax,
88-
}
89+
},
90+
polar: props.polar,
8991
};
9092
}
9193
)
@@ -122,6 +124,9 @@ export const ScatterChartConfig = (function () {
122124
{children.visualMap.getView() && children.visualMapColorMax.propertyView({
123125
label: trans("scatterChart.visualMapColorMax"),
124126
})}
127+
{children.polar.propertyView({
128+
label: trans("scatterChart.polar"),
129+
})}
125130
</>
126131
))
127132
.build();

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ export function getSeriesConfig(props: EchartsConfigProps) {
119119
config.singleAxisIndex = index;
120120
config.data = [];
121121
}
122+
if(props.chartConfig.polar) {
123+
config.coordinateSystem = 'polar';
124+
}
122125
if(s.effect) config.type = "effectScatter";
123126
if(s.symbolSize) config.symbolSize = s.symbolSize;
124127
if(s.dynamicSize) config.symbolSize = function(dataItem) {
@@ -251,6 +254,13 @@ export function getEchartsConfig(
251254
}
252255
}
253256
}
257+
if(props.chartConfig.polar) {
258+
config.angleAxis = config.xAxis;
259+
config.radiusAxis = config.yAxis;
260+
config.polar = {};
261+
delete config.xAxis;
262+
delete config.yAxis;
263+
}
254264

255265
console.log("Echarts transformedData and config", transformedData, config);
256266
return config;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ export const en = {
379379
labelLineLength2: "Label Line Length2",
380380
},
381381
scatterChart: {
382+
polar: "Polar Chart",
382383
visualMap: "Visual Map",
383384
visualMapMin: "Visual Map Min",
384385
visualMapMax: "Visual Map Max",

0 commit comments

Comments
 (0)