@@ -232,7 +232,7 @@ export class StatsBase<T extends IStatsBaseProps, O extends IStatsBaseOptions> e
232232
233233 protected _drawItems ( ctx : CanvasRenderingContext2D ) {
234234 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' ] ) ;
236236 const options = this . options ;
237237
238238 if ( options . itemRadius <= 0 || ! props . items || props . items . length <= 0 ) {
@@ -251,14 +251,19 @@ export class StatsBase<T extends IStatsBaseProps, O extends IStatsBaseOptions> e
251251 radius : options . itemRadius ,
252252 borderWidth : options . itemBorderWidth ,
253253 } ;
254+ const outliers = new Set ( props . outliers ?? [ ] ) ;
254255
255256 if ( vert ) {
256257 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+ }
258261 } ) ;
259262 } else {
260263 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+ }
262267 } ) ;
263268 }
264269 ctx . restore ( ) ;
0 commit comments