最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - HighCharts error 16 - Stack Overflow

programmeradmin0浏览0评论

I am loading high charts through an ajax call which include parameters for creating the chart. So when I select values from a dropdown filter, the chart has to be different. Now I am using a load chart function, which will work on the onchange event of dropdown and it is like this :

function load_chart(stat, type, matrix){
    chart_url = '<?=site_url('/admin/charts/index');?>';
    $("#chart_wrap").load(chart_url);
}

I need to load charts to the same #chart_wrap div. But then it is giving me this error :

uncaught exception: Highcharts error #16: www.highcharts/errors/16

and this is due to the fact that I have multiple charts in same page. So how can I fix this

I am loading high charts through an ajax call which include parameters for creating the chart. So when I select values from a dropdown filter, the chart has to be different. Now I am using a load chart function, which will work on the onchange event of dropdown and it is like this :

function load_chart(stat, type, matrix){
    chart_url = '<?=site_url('/admin/charts/index');?>';
    $("#chart_wrap").load(chart_url);
}

I need to load charts to the same #chart_wrap div. But then it is giving me this error :

uncaught exception: Highcharts error #16: www.highcharts./errors/16

and this is due to the fact that I have multiple charts in same page. So how can I fix this

Share Improve this question asked Jan 16, 2014 at 5:53 Happy CoderHappy Coder 4,70215 gold badges87 silver badges179 bronze badges 5
  • This error is a namespace conflict. Will occur when both highcharts and highstock libraries are included. – Strikers Commented Jan 16, 2014 at 5:56
  • I only have the highchart library there – Happy Coder Commented Jan 16, 2014 at 6:02
  • What about the exporting library? – SPandya Commented Jan 16, 2014 at 6:32
  • yeah it is also added. But I am not seeing the exporting buttons there – Happy Coder Commented Jan 16, 2014 at 6:40
  • did you include it on-load or including on-demand – Strikers Commented Jan 16, 2014 at 7:06
Add a ment  | 

3 Answers 3

Reset to default 4

It's probably caused by including Highcharts library every time when you load chart. You should load Highcharts library only once, and then update chart.

So this page: chart_url = '<?=site_url('/admin/charts/index');?>'; shouldn't contain Highcharts' <script> tag.

I was also receiving this error. After scouring the internet, I decided to try changing the call contained in my controller from View("SomeView", query) to PartialView("_someView", query). I renamed the actual view cshtml file from SomeView.cshtml to _someView.cshtml to follow remended naming conventions, and my error went away. That helped me, so I thought I would jot it down in case it helps somebody else out there.

In my case a page was not loaded correctly because of permission interceptor without me noticing...

The case was when i open operation from jqGrid , and it should show dialog for printing , the exception appears , and the reason is lack of permission to load resources correctly as descried in other answers so you have to have sharp eyes to know the exact problem according to your case.

发布评论

评论列表(0)

  1. 暂无评论