Skip to content

Commit 48c10a0

Browse files
committed
step line
1 parent cece2a4 commit 48c10a0

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

client/packages/lowcoder-comps/src/comps/lineChartComp/lineChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function lineChartPropertyView(
2727
<>
2828
<Section name={trans("chart.data")}>
2929
{children.chartConfig.getPropertyView()}
30-
{children.animationDuration.propertyView({label: "lineChart.animationDuration"})}
30+
{children.animationDuration.propertyView({label: trans("lineChart.animationDuration")})}
3131
<Dropdown
3232
value={children.xAxisKey.getView()}
3333
options={columnOptions}

client/packages/lowcoder-comps/src/comps/lineChartComp/lineChartUtils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export function getSeriesConfig(props: EchartsConfigProps) {
119119
borderColor: "#000",
120120
},
121121
},
122+
step: s.getView().step,
122123
encode: {
123124
x: encodeX,
124125
y: encodeY,

client/packages/lowcoder-comps/src/comps/lineChartComp/seriesComp.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ export const MarkLineTypeOptions = [
5757
},
5858
] as const;
5959

60+
export const StepOptions = [
61+
{
62+
label: trans("lineChart.none"),
63+
value: "",
64+
},
65+
{
66+
label: trans("lineChart.start"),
67+
value: "start",
68+
},
69+
{
70+
label: trans("lineChart.middle"),
71+
value: "middle",
72+
},
73+
{
74+
label: trans("lineChart.end"),
75+
value: "end",
76+
},
77+
] as const;
78+
6079
const valToLabel = (val) => MarkLineTypeOptions.find(o => o.value === val)?.label || "";
6180
const markLinesChildrenMap = {
6281
type: dropdownControl(MarkLineTypeOptions, "max"),
@@ -104,6 +123,7 @@ const seriesChildrenMap = {
104123
hide: BoolControl,
105124
// unique key, for sort
106125
dataIndex: valueComp<string>(""),
126+
step: dropdownControl(StepOptions, ""),
107127
};
108128

109129
const SeriesTmpComp = new MultiCompBuilder(seriesChildrenMap, (props) => {
@@ -129,6 +149,9 @@ class SeriesComp extends SeriesTmpComp {
129149
this.children.columnName.dispatchChangeValueAction(value);
130150
}}
131151
/>
152+
{this.children.step.propertyView({
153+
label: trans("lineChart.step"),
154+
})}
132155
<Option
133156
items={this.children.markLines.getView()}
134157
title={trans("lineChart.markLines")}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@ export const en = {
331331
showEndLabel: "End Label",
332332
symbol: "Symbol",
333333
symbolSize: "Symbol Size",
334+
animationDuration: "Animation Duration",
335+
none: "None",
336+
start: "Start",
337+
middle: "Middle",
338+
end: "End",
339+
step: "Step",
334340
},
335341
barChart: {
336342
title: 'Title',

0 commit comments

Comments
 (0)