@@ -232,7 +232,7 @@ export class StatsBase<T extends IStatsBaseProps, O extends IStatsBaseOptions> e
232
232
233
233
protected _drawItems ( ctx : CanvasRenderingContext2D ) {
234
234
const vert = this . isVertical ( ) ;
235
- const props = this . getProps ( [ 'x' , 'y' , 'items' , 'width' , 'height' ] ) ;
235
+ const props = this . getProps ( [ 'x' , 'y' , 'items' , 'width' , 'height' , 'outliers' ] ) ;
236
236
const options = this . options ;
237
237
238
238
if ( options . itemRadius <= 0 || ! props . items || props . items . length <= 0 ) {
@@ -251,14 +251,19 @@ export class StatsBase<T extends IStatsBaseProps, O extends IStatsBaseOptions> e
251
251
radius : options . itemRadius ,
252
252
borderWidth : options . itemBorderWidth ,
253
253
} ;
254
+ const outliers = new Set ( props . outliers ?? [ ] ) ;
254
255
255
256
if ( vert ) {
256
257
props . items . forEach ( ( v ) => {
257
- drawPoint ( ctx , pointOptions , props . x - props . width / 2 + random ( ) * props . width , v ) ;
258
+ if ( ! outliers . has ( v ) ) {
259
+ drawPoint ( ctx , pointOptions , props . x - props . width / 2 + random ( ) * props . width , v ) ;
260
+ }
258
261
} ) ;
259
262
} else {
260
263
props . items . forEach ( ( v ) => {
261
- drawPoint ( ctx , pointOptions , v , props . y - props . height / 2 + random ( ) * props . height ) ;
264
+ if ( ! outliers . has ( v ) ) {
265
+ drawPoint ( ctx , pointOptions , v , props . y - props . height / 2 + random ( ) * props . height ) ;
266
+ }
262
267
} ) ;
263
268
}
264
269
ctx . restore ( ) ;
0 commit comments