File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -398,10 +398,17 @@ export class YAxis extends AxisBase {
398
398
// recalculate
399
399
range = Math . abs ( max - min ) ;
400
400
401
- // calc extra spacing
402
- this . mAxisMinimum = this . mCustomAxisMin ? this . mAxisMinimum : min - ( range / 100 ) * this . getSpaceBottom ( ) ;
403
- this . mAxisMaximum = this . mCustomAxisMax ? this . mAxisMaximum : max + ( range / 100 ) * this . getSpaceTop ( ) ;
404
-
405
- this . mAxisRange = Math . abs ( this . mAxisMinimum - this . mAxisMaximum ) ;
401
+ // calc extra spacing only for range.
402
+ // using it for mAxisMinimum and mAxisMaximum would make the axis use decaled "values"
403
+ let delta = 0 ;
404
+ if ( ! this . mCustomAxisMin ) {
405
+ this . mAxisMinimum = min ;
406
+ delta += ( range / 100 ) * this . getSpaceBottom ( ) ;
407
+ }
408
+ if ( ! this . mCustomAxisMax ) {
409
+ this . mAxisMaximum = max ;
410
+ delta += ( range / 100 ) * this . getSpaceTop ( ) ;
411
+ }
412
+ this . mAxisRange = Math . abs ( this . mAxisMinimum - this . mAxisMaximum ) + delta ;
406
413
}
407
414
}
You can’t perform that action at this time.
0 commit comments