-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description
I was developing a 'DataUsage' line chart, the numbers of 'DataUsage' (unit is Byte) are big (>10^9). When I try to make the yaxis look pretty, the problem happened.
Steps to Reproduce
- set big stepSize of yaxis
- use big series data
- the browser will stuck
Expected Behavior
browser not get stuck
Cause
The scalar generates too many ticks, the error code is below:
But I think the real problem is the implement of "Utils.getGCD" function
After the operation of first three lines of code, a and b are scaled to the level of 10 to the power of p. With the default value of p being 7, that is, 10^7 to 10^8. If the maximum value of a and b is less than this range, a and b will be enlarged, which is no problem. If a and b are greater than this range, a and b will be reduced, which will obviously cause problems, making the final result less than the actual greatest common divisor of a and b.
By the way, the variable name "big" is confusing. I think "factor" would be much better.