File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 674
674
var
675
675
step = module . get . step ( ) ,
676
676
min = module . get . min ( ) ,
677
- quotient = step === 0 ? 0 : Math . floor ( ( settings . max - min ) / step ) ,
677
+ precision = module . get . precision ( ) ,
678
+ quotient = step === 0 ? 0 : Math . floor ( Math . round ( ( ( settings . max - min ) / step ) * precision ) / precision ) ,
678
679
remainder = step === 0 ? 0 : ( settings . max - min ) % step
679
680
;
680
681
684
685
return settings . step ;
685
686
} ,
686
687
numLabels : function ( ) {
687
- var value = Math . round ( ( module . get . max ( ) - module . get . min ( ) ) / ( module . get . step ( ) === 0 ? 1 : module . get . step ( ) ) ) ;
688
+ var step = module . get . step ( ) ,
689
+ precision = module . get . precision ( ) ,
690
+ value = Math . round ( ( ( module . get . max ( ) - module . get . min ( ) ) / ( step === 0 ? 1 : step ) ) * precision ) / precision ;
688
691
module . debug ( 'Determined that there should be ' + value + ' labels' ) ;
689
692
690
693
return value ;
699
702
700
703
switch ( settings . labelType ) {
701
704
case settings . labelTypes . number : {
702
- return Math . round ( ( ( value * ( module . get . step ( ) === 0 ? 1 : module . get . step ( ) ) ) + module . get . min ( ) ) * precision ) / precision ;
705
+ var step = module . get . step ( ) ;
706
+
707
+ return Math . round ( ( ( value * ( step === 0 ? 1 : step ) ) + module . get . min ( ) ) * precision ) / precision ;
703
708
}
704
709
case settings . labelTypes . letter : {
705
710
return alphabet [ value % 26 ] ;
You can’t perform that action at this time.
0 commit comments