File tree 2 files changed +23
-0
lines changed
__tests__/unit/plots/ring-progress
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -327,4 +327,24 @@ describe('ring-progress', () => {
327
327
it ( 'defaultOptions 保持从 constants 中获取' , ( ) => {
328
328
expect ( RingProgress . getDefaultOptions ( ) ) . toEqual ( DEFAULT_OPTIONS ) ;
329
329
} ) ;
330
+
331
+ it ( 'z-index' , ( ) => {
332
+ const ringProgress = new RingProgress ( createDiv ( ) , {
333
+ radius : 1 ,
334
+ innerRadius : 0.5 ,
335
+ width : 200 ,
336
+ height : 100 ,
337
+ percent : 0.6 ,
338
+ autoFit : false ,
339
+ } ) ;
340
+
341
+ ringProgress . render ( ) ;
342
+ let elements = ringProgress . chart . geometries [ 0 ] . elements ;
343
+ expect ( elements [ 0 ] . shape . get ( 'zIndex' ) ) . toBeGreaterThan ( elements [ 1 ] . shape . get ( 'zIndex' ) ) ;
344
+ ringProgress . changeData ( 0.7 ) ;
345
+ elements = ringProgress . chart . geometries [ 0 ] . elements ;
346
+ expect ( elements [ 0 ] . shape . get ( 'zIndex' ) ) . toBeGreaterThan ( elements [ 1 ] . shape . get ( 'zIndex' ) ) ;
347
+
348
+ ringProgress . destroy ( ) ;
349
+ } ) ;
330
350
} ) ;
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ export function geometry(params: Params<ProgressOptions>): Params<ProgressOption
28
28
style : progressStyle ,
29
29
color : isString ( color ) ? [ color , DEFAULT_COLOR [ 1 ] ] : color ,
30
30
} ,
31
+ args : {
32
+ zIndexReversed : true ,
33
+ } ,
31
34
} ,
32
35
} ) ;
33
36
You can’t perform that action at this time.
0 commit comments