File tree 3 files changed +14
-17
lines changed
3 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 40
40
<div style =" border : 1px solid red ; display : inline-block " >
41
41
<ve-progress
42
42
:size =" 600"
43
- half
44
43
:angle =" 0"
45
- line-position =" out 70 "
44
+ line-position =" out 26 "
46
45
empty-line-position =" out 20"
47
46
empty-color-fill =" red"
48
- color-fill =" green "
49
- empty-color =" transparent "
47
+ color-fill =" #273266 "
48
+ empty-color =" blue "
50
49
:progress =" progress"
51
50
:no-data =" noData"
52
51
>
Original file line number Diff line number Diff line change 1
- import { emptyRadius , radius } from "@/components/Circle/radiusCalculation" ;
1
+ import { emptyRadius , fillRadius , radius } from "@/components/Circle/radiusCalculation" ;
2
2
import { isValidNumber } from "../../utils" ;
3
3
4
4
const wait = ( ms = 400 ) => new Promise ( ( resolve ) => setTimeout ( ( ) => resolve ( ) , ms ) ) ;
@@ -33,23 +33,13 @@ export default {
33
33
return radius ( this . options ) ;
34
34
} ,
35
35
fillRadius ( ) {
36
- const { offset, position } = this . options . linePosition ;
37
- if ( position === "center" ) {
38
- return this . radius ;
39
- }
40
- return position === "out" ? this . radius - offset - this . thickness / 2 : this . radius + this . thickness / 2 ;
36
+ return fillRadius ( this . options . linePosition , this . thickness , this . radius ) ;
41
37
} ,
42
38
emptyRadius ( ) {
43
39
return emptyRadius ( this . options ) ;
44
40
} ,
45
41
emptyFillRadius ( ) {
46
- const { offset, position } = this . options . emptyLinePosition ;
47
- if ( position === "center" ) {
48
- return this . emptyRadius ;
49
- }
50
- return position === "out"
51
- ? this . emptyRadius - offset - this . emptyThickness / 2
52
- : this . emptyRadius + this . emptyThickness / 2 ;
42
+ return fillRadius ( this . options . emptyLinePosition , this . emptyThickness , this . emptyRadius ) ;
53
43
} ,
54
44
55
45
dataIsAvailable ( ) {
Original file line number Diff line number Diff line change @@ -105,3 +105,11 @@ export const emptyRadius = (options) => {
105
105
const modeHandler = modes [ options . lineMode . mode ] ;
106
106
return modeHandler ? modeHandler ( ) : emptyBaseRadius ( options ) ;
107
107
} ;
108
+
109
+ export const fillRadius = ( linePosition , thickness , lineCircleRadius ) => {
110
+ const { position, offset } = linePosition ;
111
+ if ( position === "center" ) {
112
+ return lineCircleRadius ;
113
+ }
114
+ return position === "out" ? lineCircleRadius - offset - thickness / 2 : lineCircleRadius + thickness / 2 ;
115
+ } ;
You can’t perform that action at this time.
0 commit comments