File tree 2 files changed +3
-6
lines changed
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ class Range {
426
426
ticks = gl . series [ gl . maxValsInArrayIndex ] . length - 1
427
427
}
428
428
if ( gl . isXNumeric ) {
429
- const diff = gl . maxX - gl . minX
429
+ const diff = Math . round ( gl . maxX - gl . minX )
430
430
if ( diff < 30 ) {
431
431
ticks = diff - 1
432
432
}
Original file line number Diff line number Diff line change @@ -436,7 +436,7 @@ export default class Scales {
436
436
step = range / ticks
437
437
}
438
438
439
- step = Math . round ( ( step + Number . EPSILON ) * 10 ) / 10
439
+ step = Math . round ( ( step + Number . EPSILON ) * 100 ) / 100
440
440
441
441
if ( ticks === Number . MAX_VALUE ) {
442
442
ticks = 5
@@ -582,16 +582,13 @@ export default class Scales {
582
582
setXScale ( minX , maxX ) {
583
583
const w = this . w
584
584
const gl = w . globals
585
- let diff = Math . abs ( maxX - minX )
585
+ let diff = Math . round ( Math . abs ( maxX - minX ) )
586
586
if ( maxX === - Number . MAX_VALUE || ! Utils . isNumber ( maxX ) ) {
587
587
// no data in the chart. Either all series collapsed or user passed a blank array
588
588
gl . xAxisScale = this . linearScale ( 0 , 10 , 10 )
589
589
} else {
590
590
let ticks = gl . xTickAmount
591
591
592
- if ( diff < 10 && diff > 1 ) {
593
- ticks = diff
594
- }
595
592
gl . xAxisScale = this . linearScale (
596
593
minX ,
597
594
maxX ,
You can’t perform that action at this time.
0 commit comments