Skip to content

Commit cece2a4

Browse files
committed
animation duration & symbol
1 parent a60dad0 commit cece2a4

File tree

5 files changed

+59
-1
lines changed

5 files changed

+59
-1
lines changed

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
withContext,
1212
RedButton,
1313
StringControl,
14+
NumberControl,
15+
withDefault,
1416
ColorOrBoolCodeControl,
1517
} from "lowcoder-sdk";
1618
import { trans } from "i18n/comps";
@@ -28,6 +30,45 @@ export const ItemColorComp = withContext(
2830
["seriesName", "value"] as const
2931
);
3032

33+
export const SymbolOptions = [
34+
{
35+
label: trans("chart.rect"),
36+
value: "rect",
37+
},
38+
{
39+
label: trans("chart.circle"),
40+
value: "circle",
41+
},
42+
{
43+
label: trans("chart.roundRect"),
44+
value: "roundRect",
45+
},
46+
{
47+
label: trans("chart.triangle"),
48+
value: "triangle",
49+
},
50+
{
51+
label: trans("chart.diamond"),
52+
value: "diamond",
53+
},
54+
{
55+
label: trans("chart.pin"),
56+
value: "pin",
57+
},
58+
{
59+
label: trans("chart.arrow"),
60+
value: "arrow",
61+
},
62+
{
63+
label: trans("chart.none"),
64+
value: "none",
65+
},
66+
{
67+
label: trans("chart.emptyCircle"),
68+
value: "emptyCircle",
69+
},
70+
] as const;
71+
3172
export const LineChartConfig = (function () {
3273
return new MultiCompBuilder(
3374
{
@@ -37,13 +78,17 @@ export const LineChartConfig = (function () {
3778
area: BoolControl,
3879
smooth: BoolControl,
3980
itemColor: ItemColorComp,
81+
symbol: dropdownControl(SymbolOptions, "emptyCircle"),
82+
symbolSize: withDefault(NumberControl, 4),
4083
},
4184
(props): LineSeriesOption => {
4285
const config: LineSeriesOption = {
4386
type: "line",
4487
label: {
4588
show: props.showLabel,
4689
},
90+
symbol: props.symbol,
91+
symbolSize: props.symbolSize,
4792
itemStyle: {
4893
color: (params) => {
4994
if (!params.encode || !params.dimensionNames) {
@@ -94,6 +139,12 @@ export const LineChartConfig = (function () {
94139
{children.showEndLabel.propertyView({
95140
label: trans("lineChart.showEndLabel"),
96141
})}
142+
{children.symbol.propertyView({
143+
label: trans("lineChart.symbol"),
144+
})}
145+
{children.symbolSize.propertyView({
146+
label: trans("lineChart.symbolSize"),
147+
})}
97148
{children.smooth.propertyView({ label: trans("chart.smooth") })}
98149
{children.itemColor.getPropertyView()}
99150
</>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ export const chartUiModeChildren = {
254254
legendConfig: LegendConfig,
255255
chartConfig: ChartOptionComp,
256256
areaPieces: list(AreaPiecesTmpComp),
257+
animationDuration: withDefault(NumberControl, 1000),
257258
onUIEvent: eventHandlerControl(UIEventOptions),
258259
};
259260

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export function getEchartsConfig(
203203
...gridPos,
204204
containLabel: true,
205205
},
206+
animationDuration: props.animationDuration,
206207
};
207208
if (props.areaPieces.length > 0) {
208209
config.visualMap = {
@@ -219,7 +220,6 @@ export function getEchartsConfig(
219220
))
220221
}
221222
}
222-
console.log("config", config)
223223
if(props.chartConfig.race) {
224224
config = {
225225
...config,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ export const en = {
329329
areaPieces: "Area Pieces",
330330
areaPiece: "Area Piece",
331331
showEndLabel: "End Label",
332+
symbol: "Symbol",
333+
symbolSize: "Symbol Size",
332334
},
333335
barChart: {
334336
title: 'Title',
@@ -555,6 +557,9 @@ export const en = {
555557
diamond: "Diamond",
556558
pin: "Pin",
557559
arrow: "Arrow",
560+
emptyCircle: "Empty Circle",
561+
none: "None",
562+
roundRect: "Round Rectangle",
558563
pointColorLabel: "Point Color",
559564
pointColorTooltip:
560565
'Set point color based on series name and value. Variables: seriesName, value. Example: \'{{value < 25000 ? "red" : "green"}}\'',

0 commit comments

Comments
 (0)