HighCharts.js is not rendering chart under IE8

后端 未结 1 1676
花落未央
花落未央 2021-01-12 00:19

I am using HighCharts together with Python to dynamically create charts. All works fine, however I get cannot read property \"0\" of undefined exception under I

相关标签:
1条回答
  • 2021-01-12 01:00

    Those dangling commas are causing errors in Internet Explorer. Get rid of them.

    Here's an example:

        chart: {
            renderTo: 'company_chart', // <--- get rid of that comma
        },
    

    Internet Explorer considers a comma at the end of an object literal like that to be an error. You should in fact be seeing the "Errors on page" warning, but the error is usually something that does not indicate this actual root cause.

    edit — well apparently IE8 is not picky about that, though IE7 is.

    edit againHowever, IE8 interprets that last dangling comma in your data arrays as meaning that there should be an extra element! In other words:

     [1, 2, 3,].length
    

    is 3 in Firefox/Chrome/Safari but it's 4 in Internet Explorer. When you try to access that element, the browser gives you undefined.

    0 讨论(0)
提交回复
热议问题