Skip to content

Commit 703a322

Browse files
committed
mark line
1 parent c6324b4 commit 703a322

File tree

3 files changed

+72
-1
lines changed

3 files changed

+72
-1
lines changed

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

+38-1
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,45 @@ export function getSeriesConfig(props: EchartsConfigProps) {
8080
color: s.itemColor,
8181
shadowColor: s.itemShadowColor,
8282
shadowBlur: s.itemShadowBlur,
83-
}
83+
},
84+
}
85+
let fromArr = [0,0];
86+
let toArr = [0,0];
87+
try {
88+
fromArr = JSON.parse(s.markLineFrom);
89+
} catch {}
90+
try {
91+
toArr = JSON.parse(s.markLineTo);
92+
} catch {}
93+
if(s.showMarkLine) {
94+
config.markLine = {
95+
animation: false,
96+
label: {
97+
formatter: s.markLineDesc,
98+
align: 'right'
99+
},
100+
lineStyle: {
101+
type: 'solid'
102+
},
103+
tooltip: {
104+
formatter: s.markLineDesc
105+
},
106+
data: [
107+
[
108+
{
109+
coord: fromArr,
110+
symbol: 'none'
111+
},
112+
{
113+
coord: toArr,
114+
symbol: 'none'
115+
}
116+
]
117+
]
118+
};
84119
}
120+
if(s.effect) config.type = "effectScatter";
121+
if(s.symbolSize) config.symbolSize = s.symbolSize;
85122
return config;
86123
});
87124
}

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

+26
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {
55
list,
66
dropdownControl,
77
withDefault,
8+
jsonControl,
9+
toArray,
810
NumberControl,
911
isNumeric,
1012
genRandomKey,
@@ -37,6 +39,12 @@ export function newSeries(name: string, columnName: string): SeriesDataType {
3739
const seriesChildrenMap = {
3840
columnName: StringControl,
3941
seriesName: StringControl,
42+
symbolSize: NumberControl,
43+
effect: BoolControl,
44+
showMarkLine: BoolControl,
45+
markLineFrom: withDefault(StringControl, "[0,0]"),
46+
markLineTo: withDefault(StringControl, "[1000,1000]"),
47+
markLineDesc: StringControl,
4048
hide: BoolControl,
4149
// unique key, for sort
4250
dataIndex: valueComp<string>(""),
@@ -65,6 +73,24 @@ class SeriesComp extends SeriesTmpComp {
6573
this.children.columnName.dispatchChangeValueAction(value);
6674
}}
6775
/>
76+
{this.children.effect.propertyView({
77+
label: trans("scatterChart.effect"),
78+
})}
79+
{this.children.symbolSize.propertyView({
80+
label: trans("scatterChart.symbolSize"),
81+
})}
82+
{this.children.showMarkLine.propertyView({
83+
label: trans("scatterChart.showMarkLine"),
84+
})}
85+
{this.children.showMarkLine.getView() && this.children.markLineFrom.propertyView({
86+
label: trans("scatterChart.from"),
87+
})}
88+
{this.children.showMarkLine.getView() && this.children.markLineTo.propertyView({
89+
label: trans("scatterChart.to"),
90+
})}
91+
{this.children.showMarkLine.getView() && this.children.markLineDesc.propertyView({
92+
label: trans("scatterChart.desc"),
93+
})}
6894
</>
6995
);
7096
}

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

+8
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,14 @@ export const en = {
378378
labelLineLength: "Label Line Length",
379379
labelLineLength2: "Label Line Length2",
380380
},
381+
scatterChart: {
382+
effect: "Effect",
383+
symbolSize: "Symbol Size",
384+
from: "From",
385+
to: "To",
386+
showMarkLine: "Show Mark Line",
387+
desc: "Description",
388+
},
381389
barChart: {
382390
title: 'Title',
383391
barWidth: 'Bar Width(%)',

0 commit comments

Comments
 (0)