Possible Duplicate:
HighCharts uncaught exception
I'm trying to instantiate a highcharts objects with this code:
$(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);
});
})
The console logs the returned json appropriately.
When I copy and past in the json to where the (json) is, the chart renders. However, as it is now, it throws the following error: Uncaught Highcharts error #13: www.highcharts.com/errors/13
Following that link it says:
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
However, again, if I copy and past the json (from the console) to where the variable would otherwise be, it works fine.
I'm sure this is something simple. What am I doing wrong here?