HighCharts uncaught exception

后端 未结 3 1211
盖世英雄少女心
盖世英雄少女心 2021-01-13 09:42

I am trying to run the same code in this jsFiddle locally but I got error from firebug

uncaught exception: Highcharts error #13: www.highcharts.com/errors/1         


        
3条回答
  •  庸人自扰
    2021-01-13 10:10

    The element/div you are trying to render the chart to is missing

    A standard set of logs that I would use to troubleshoot highcharts error #13 are

            console.log("JSON: " + JSON.stringify(chartingOptions));
            console.log("Render to element with ID : " + chartingOptions.chart.renderTo);
            console.log("Number of matching dom elements : " + $("#" + chartingOptions.chart.renderTo).length);
    

    These should be added just before calling the Highcharts constructor

            chart = new Highcharts.Chart(chartingOptions);
    

    If all is well you should see the correct element ID, and length as 1.

    Troubleshooting highcharts error # 13 | Highchart & Highstock @ jsFiddle

    Here is the log that is seen for the demo above

    JSON: {"chart":{"renderTo":"container"...}}
    Render to element with ID : container
    Number of matching dom elements : 1

提交回复
热议问题