File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -48,18 +48,16 @@ const svg = computed(() => {
4848 return options[FINAL_CONFIG .value .type ];
4949});
5050
51- const barBody = computed (() => {
52- const x = 70 * (props .dataset / 100 )
53- return ` M 5 10 L 5 10 C 5 13 7 15 10 15 L ${ x} 15 C ${ x + 3 } 15 ${ x + 5 } 13 ${ x + 5 } 10 L ${ x + 5 } 10 C ${ x + 5 } 7 ${ x + 3 } 5 ${ x} 5 L 10 5 C 7 5 5 7 5 10`
54- })
55-
5651const gaugeBody = computed (() => {
57- const circumference = 35 * (2 + (props .dataset / 100 > 1 ? 0 : 1 - props .dataset / 100 )) * Math .PI ;
52+ const radius = 35 ;
53+ const circumference = 2 * Math .PI * radius;
54+ const dashoffset = circumference - (props .dataset / 100 ) * circumference;
55+
5856 return {
5957 dasharray: ` ${ circumference} ${ circumference} ` ,
60- dashoffset: circumference - props . dataset / 100 * circumference,
61- }
62- })
58+ dashoffset: dashoffset
59+ };
60+ });
6361
6462 </script >
6563
You can’t perform that action at this time.
0 commit comments