Skip to content

Commit f421dd0

Browse files
committed
Added Stage clock to gauge chart(not editing).
1 parent b7af382 commit f421dd0

File tree

1 file changed

+181
-5
lines changed

1 file changed

+181
-5
lines changed

client/packages/lowcoder-comps/src/comps/gaugeChartComp/gaugeChartUtils.ts

Lines changed: 181 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,187 @@ export function getEchartsConfig(
822822
}
823823

824824
let clockGaugeOpt = {
825-
...basic,
826-
"title": {
827-
...basic.title,
828-
"text": "clockGaugeOpt",
829-
}
825+
...basicStyle,
826+
series: [
827+
{
828+
...basicSeries,
829+
name: 'hour',
830+
type: 'gauge',
831+
startAngle: 90,
832+
endAngle: -270,
833+
min: 0,
834+
max: 12,
835+
center: ['50%', '50%'],
836+
splitNumber: 12,
837+
clockwise: true,
838+
axisLine: {
839+
lineStyle: {
840+
width: 15,
841+
color: [[1, 'rgba(0,0,0,0.7)']],
842+
shadowColor: 'rgba(0, 0, 0, 0.5)',
843+
shadowBlur: 15
844+
}
845+
},
846+
splitLine: {
847+
lineStyle: {
848+
shadowColor: 'rgba(0, 0, 0, 0.3)',
849+
shadowBlur: 3,
850+
shadowOffsetX: 1,
851+
shadowOffsetY: 2
852+
}
853+
},
854+
axisLabel: {
855+
fontSize: 15,
856+
distance: 20,
857+
formatter: function (value) {
858+
if (value === 0) {
859+
return '';
860+
}
861+
return value + '';
862+
}
863+
},
864+
pointer: {
865+
icon: 'path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z',
866+
width: 6,
867+
length: '55%',
868+
offsetCenter: [0, '8%'],
869+
itemStyle: {
870+
color: '#C0911F',
871+
shadowColor: 'rgba(0, 0, 0, 0.3)',
872+
shadowBlur: 8,
873+
shadowOffsetX: 2,
874+
shadowOffsetY: 4
875+
}
876+
},
877+
detail: {
878+
show: false
879+
},
880+
title: {
881+
offsetCenter: [0, '30%']
882+
},
883+
data: [
884+
{
885+
value: 0
886+
}
887+
]
888+
},
889+
{
890+
name: 'minute',
891+
type: 'gauge',
892+
startAngle: 90,
893+
endAngle: -270,
894+
min: 0,
895+
max: 60,
896+
clockwise: true,
897+
axisLine: {
898+
show: false
899+
},
900+
splitLine: {
901+
show: false
902+
},
903+
axisTick: {
904+
show: false
905+
},
906+
axisLabel: {
907+
show: false
908+
},
909+
pointer: {
910+
icon: 'path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z',
911+
width: 4,
912+
length: '70%',
913+
offsetCenter: [0, '8%'],
914+
itemStyle: {
915+
color: '#C0911F',
916+
shadowColor: 'rgba(0, 0, 0, 0.3)',
917+
shadowBlur: 8,
918+
shadowOffsetX: 2,
919+
shadowOffsetY: 4
920+
}
921+
},
922+
anchor: {
923+
show: true,
924+
size: 10,
925+
showAbove: false,
926+
itemStyle: {
927+
borderWidth: 15,
928+
borderColor: '#C0911F',
929+
shadowColor: 'rgba(0, 0, 0, 0.3)',
930+
shadowBlur: 8,
931+
shadowOffsetX: 2,
932+
shadowOffsetY: 4
933+
}
934+
},
935+
detail: {
936+
show: false
937+
},
938+
title: {
939+
offsetCenter: ['0%', '-40%']
940+
},
941+
data: [
942+
{
943+
value: 20
944+
}
945+
]
946+
},
947+
{
948+
name: 'second',
949+
type: 'gauge',
950+
startAngle: 90,
951+
endAngle: -270,
952+
min: 0,
953+
max: 60,
954+
animationEasingUpdate: 'bounceOut',
955+
clockwise: true,
956+
axisLine: {
957+
show: false
958+
},
959+
splitLine: {
960+
show: false
961+
},
962+
axisTick: {
963+
show: false
964+
},
965+
axisLabel: {
966+
show: false
967+
},
968+
pointer: {
969+
icon: 'path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z',
970+
width: 2,
971+
length: '85%',
972+
offsetCenter: [0, '8%'],
973+
itemStyle: {
974+
color: '#C0911F',
975+
shadowColor: 'rgba(0, 0, 0, 0.3)',
976+
shadowBlur: 8,
977+
shadowOffsetX: 2,
978+
shadowOffsetY: 4
979+
}
980+
},
981+
anchor: {
982+
show: true,
983+
size: 15,
984+
showAbove: true,
985+
itemStyle: {
986+
color: '#C0911F',
987+
shadowColor: 'rgba(0, 0, 0, 0.3)',
988+
shadowBlur: 8,
989+
shadowOffsetX: 2,
990+
shadowOffsetY: 4
991+
}
992+
},
993+
detail: {
994+
show: false
995+
},
996+
title: {
997+
offsetCenter: ['0%', '-40%']
998+
},
999+
data: [
1000+
{
1001+
value: 40
1002+
}
1003+
]
1004+
}
1005+
]
8301006
}
8311007

8321008
const typeMap = {

0 commit comments

Comments
 (0)