Create a div and render to it
Description
The following code shows how to create a div and render to it.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(function () {<!-- www . j av a 2s .com-->
var container = document.createElement('div');
document.body.appendChild(container);
window.chart = new Highcharts.Chart({
chart: {
renderTo: container,
height: 400
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [129.9, 171.5, 106.4, 19.2, 14.0, 176.0, 35.6, 148.5, 16.4, 194.1, 5.6, 154.4]
}]
});
});
</script>
</head>
<body>
<script src="http://code.highcharts.com/highcharts.js"></script>
</body>
</html>