New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logarithmic Line Chart IE Endless Loop (2.7.1 - bundle) #5264
Comments
Thanks for reporting this. I'm surprised that this causes problems .... the variable should always be an integer since we only add 1 or set it to a rounded value. |
The problem is caused by IE11 not having |
ah, ok. that makes sense. Unfortunately there is no good way to improve the polyfill on IE11. Could you PR that fix if possible? |
I have done some testing and helpers.log10 = Math.log10 ?
function(x) {
return Math.log10(x);
} :
function(x) {
var exponent = Math.log(x) * Math.LOG10E;
// check for floating point rounding error
var exponent10 = Math.floor(exponent) + 1
var isExponent10 = (x / Math.pow(10, exponent10)) === 1;
return isExponent10 ? exponent10 : exponent;
}; |
Done in #5275 |
Logarithmic charts causing Endless Loop in Internet Explorer 11. You can reproduce the problem by using the link below;
https://jsfiddle.net/bj9gkn3o/4/
Expected Behavior
In Chrome the graphic works perfectly.
Current Behavior
In Internet Explorer, ChartJs causes Endless Loop while generating a set of logarithmic ticks. Then ends up with out of memory exception. The reason "significand" on ticks.
Possible Solution
Chart.js/src/scales/scale.logarithmic.js
Line 42 in 584d1c6
I changed this line as "if (significand >= 10) {" and now it's working on IE 11.
Steps to Reproduce (for bugs)
https://jsfiddle.net/bj9gkn3o/4/
Context
ChartJS 2.7.1 (v2.6 also has this problem)
Environment
IE 11
The text was updated successfully, but these errors were encountered: