score:18
This means that Highcharts is loaded and the config is loaded, but the renderTo option is wrong, or there is no div with that id in the page. See www.highcharts.com/errors/13.
score:2
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
score:2
I think I know why you should add that tag after the div /div. If you are using a JSP or any other server-side stuf. You should add your Highcharts script after the declaration of the div container so it can recognize your div's id and then proceed to render it. Just like I did in the example bellow:
<head>
<title>HighCharts :D</title>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body>
<div id="container" style="width: 600px; height: 400px; margin: 0 auto">
</div>
<script type="text/javascript">
var myChart = Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
</script>
</body>
Source: stackoverflow.com
Related Query
- HighCharts uncaught exception
- Uncaught TypeError: e.doDrilldown is not a function - Highcharts
- Uncaught TypeError: undefined is not a function - Highcharts - MVC
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Uncaught TypeError: undefined is not a function when using highcharts
- Highcharts - Global configuration with common code and unique data & Headings
- Uncaught TypeError: Cannot read property 'chart' of undefined in highcharts
- HighCharts Stock Chart error code 18
- highcharts change rendered image source on click
- highcharts heatmap Uncaught TypeError: Cannot read property 'prototype' of undefined
- Uncaught Highcharts error #19: www.highcharts.com/errors/19
- How do i add mouse wheel code in Angular2 highcharts in typescript
- how to display 2 same highcharts without duplicate the code
- Use of DotNet HighCharts dll to make charts in code behind
- How to edit tooltip in Highcharts C# code
- what means ${demo.css} in example files of highcharts ? That piece of code seems to be literal
- passing json values to highcharts from .net code behind
- how to use highcharts tooltip formatter in python code
- passing formatting JavaScript code to HighCharts with JSON
- Uncaught TypeError: Object [object Object] has no method 'getElementsByTagName' in Highcharts
- Highcharts JS Uncaught TypeError: x[(intermediate value)(intermediate value)(intermediate value)] is not a constructor
- Highcharts display label for pie chart using html table as data source
- Simple, Open source PHP wrapper for Highcharts library
- Add Source to Highcharts Export CSV
- Include additional highcharts source data in angular2 app
- Conditions within highcharts code
- Strange character in the Highstock source code
- What's the code in Highcharts such that the bars (columns) in the same group use the same color?
- I am facing this error highcharts.js:formatted:1 Uncaught ReferenceError: Highcharts is not defined can any one help me with this
- Highcharts series visibility with csv data source
More Query from same tag
- Boost Enable/Disabled with update Method in Highcharts
- how to sync height & y-axis baseline of multiple chart in highcharts
- Cannot read property 'cum' of undefined -- when creating a stacked area chart with xAxis.type=datetime
- Show highcharts for database data
- Non-zero fill centerpoint for highcharts/highstock?
- HighCharts specifying min, max and tickInterval not giving expected results
- How to add click event on django-chatit chart
- some of dataLabels not showing in stacked column Highchart
- How to Multiply two arrays and dynamically plot into HighCharts?
- Highcharts chart not loading after AJAX call to insert partial containing chart
- Highcharts clickhandler and accessing context
- How can I deal with Highcharts inline styles to prevent Content-Security-Policy violations?
- Fire bootstrap modal from a highcharts x axis label?
- How to use images/icons as labels in highcharter? R shiny
- Turning off animation in HighCharts globally
- Highcharts HeatMap cell color disappears when hover in Internet Explorer
- HTML displaying values in JavaScript "data"
- Highcharts.stockChart x-axis data for irregular time-stamped scatter breaks date range-handling
- change data in highchart on changing selection from dropdown
- How to show popup on highchart column click
- Display maximum value of a highcharts stacked column on the bottom
- Higchahrts click entire column to trigger point click event
- Javascript stockchart graph
- How to set up drilldown feature for multiple boxplot series in highcharter?
- Highchart selection without zoom
- how to add text in top,left and bottom in funnel highcharts
- Drawing a regression line in Highcharts using mx + b
- In highcharts, is it possible get the exact position of x axis labels for overlap detection purpose?
- Highcharts dynamic height with table layout
- Firefox && IE TypeError: Argument 1 of Window.getComputedStyle does not implement interface Element