How can I fix Highcharts error #13?

前端 未结 9 2099
迷失自我
迷失自我 2020-12-11 15:59

I use highchart so, the user can close and open the chart page and redraw the chart, in some case give me this error, how can I fix it, Thanks Here is my code



        
相关标签:
9条回答
  • 2020-12-11 16:33

    Also, make sure "highcharts-more.js" is declared in your HTML.

    <script src="https://code.highcharts.com/highcharts-more.js"></script>
    
    0 讨论(0)
  • 2020-12-11 16:34

    Perhaps a bit late to the party, but the default name for the container in Highcharts example was 'container'. The browser didn't seem to like that, name clash perhaps, changing to 'Chart' did the trick.

    0 讨论(0)
  • 2020-12-11 16:34

    This is an old question, but none of the answers are really satisfactory in my opinion.

    I would suggest checking to make sure the chart div exists before rendering the chart.

    if($('#'+id).length){ $('#'+id).highcharts({});}
    
    0 讨论(0)
提交回复
热议问题