Possible Duplicate:
HighCharts uncaught exceptionHighcharts錯誤#13,而在Ajax調用
我試圖實例化一個highcharts與此代碼的對象實例化highchart:
$(function() {
var chart;
var json = null;
$.getJSON('{% url ajax_search 'pie_chart' %}?{{request.META.QUERY_STRING}}',
function(data, textStatus, jqXHR)
{
json = data.template;
console.log(json);
chart = new Highcharts.Chart(json);
});
})
控制檯適當記錄返回的JSON。
當我複製並過去的JSON到(json)的位置時,圖表呈現。然而,因爲它是現在,它引發以下錯誤:未捕獲Highcharts錯誤#13:www.highcharts.com/errors/13
下面這個鏈接,它說:
This error occurs if the chart.renderTo option is misconfugured so that Highcharts is unable to find the HTML element to render the chart in
但是,同樣,如果我複製並通過json(從控制檯)到變量將會在其中的位置,它工作正常。
我相信這是簡單的。我在這裏做錯了什麼?
入住chart.renderTo指定元素在被執行的代碼的時刻存在的演示日誌。 –