Skip to content

Commit

Permalink
Fix null reference (#1785)
Browse files Browse the repository at this point in the history
When tickDecimals is null adding an extra tickdecimal when range is .25
will fail.

0 - 0.25 - 0.5 - 0.75 - 1 will be incorrectly rounded to 0 - 0.3 - 0.5 - 0.8
  • Loading branch information
tomkooij authored Jul 16, 2021
1 parent d0f569a commit 370cf6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/jquery.flot.js
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ Licensed under the MIT license.
var magn = parseFloat('1e' + (-dec)),
norm = delta / magn;

if (norm > 2.25 && norm < 3 && (dec + 1) <= tickDecimals) {
if (norm > 2.25 && norm < 3 && (tickDecimals == null || (dec + 1) <= tickDecimals)) {
//we need an extra decimals when tickSize is 2.5
++dec;
}
Expand Down

0 comments on commit 370cf6e

Please sign in to comment.