Skip to content

Commit 0580fe4

Browse files
committed
race chart
1 parent 5da87e0 commit 0580fe4

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

client/packages/lowcoder-comps/src/comps/barChartComp/barChartUtils.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@ export function getEchartsConfig(
191191
containLabel: true,
192192
},
193193
};
194+
if(props.chartConfig.race) {
195+
config = {
196+
...config,
197+
// Disable init animation.
198+
animationDuration: 0,
199+
animationDurationUpdate: 2000,
200+
animationEasing: 'linear',
201+
animationEasingUpdate: 'linear',
202+
}
203+
}
194204
if (props.data.length <= 0) {
195205
// no data
196206
return {
@@ -307,6 +317,22 @@ export function getEchartsConfig(
307317
}
308318
},
309319
};
320+
321+
if(props.chartConfig.race) {
322+
config = {
323+
...config,
324+
xAxis: {
325+
...config.xAxis,
326+
animationDuration: 300,
327+
animationDurationUpdate: 300
328+
},
329+
yAxis: {
330+
...config.yAxis,
331+
animationDuration: 300,
332+
animationDurationUpdate: 300
333+
},
334+
}
335+
}
310336
}
311337

312338
//Waterfall x-label initialization

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ export const BarChartConfig = (function () {
4848
polarStartAngle: withDefault(NumberControl, 90),
4949
polarEndAngle: withDefault(NumberControl, -180),
5050
polarIsTangent: withDefault(BoolControl, false),
51+
race: withDefault(BoolControl, false),
5152
labelData: jsonControl(toArray, []),
5253
},
5354
(props): BarSeriesOption => {
5455
const config: BarSeriesOption = {
5556
type: "bar",
5657
subtype: props.type,
58+
realtimeSort: props.race,
59+
seriesLayoutBy: props.race?'column':undefined,
5760
label: {
5861
show: props.showLabel,
5962
position: "top",
63+
valueAnimation: props.race,
6064
},
6165
barWidth: `${props.barWidth}%`,
6266
showBackground: props.showBackground,
@@ -71,8 +75,8 @@ export const BarChartConfig = (function () {
7175
polarEndAngle: props.polarEndAngle,
7276
labelData: props.labelData,
7377
polarIsTangent: props.polarIsTangent,
74-
}
75-
78+
},
79+
race: props.race,
7680
};
7781
if (props.type === "stackedBar") {
7882
config.stack = "stackValue";
@@ -101,6 +105,9 @@ export const BarChartConfig = (function () {
101105
{children.barWidth.propertyView({
102106
label: trans("barChart.barWidth"),
103107
})}
108+
{children.race.propertyView({
109+
label: trans("barChart.race"),
110+
})}
104111
{children.showBackground.propertyView({
105112
label: trans("barChart.showBg"),
106113
})}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ export const en = {
315315
barChart: {
316316
title: 'Title',
317317
barWidth: 'Bar Width(%)',
318+
race: 'Race',
318319
showBg: 'Show Bar Background',
319320
bgColor: 'Background Color',
320321
polarIsTangent: 'Tangential Chart',

0 commit comments

Comments
 (0)