First of all, I'm a novice in programming websites, so please bear with me for asking basic questions....
Im trying to incorporate a test highchart in a otherwise empty html page. I'm just following the steps of "Your first Highchart", but cannot get it to work All I get is a blank container.... When looking at the error in the browser, it seems it doesn't recognize the $ function.... What am I doing wrong? Your help would be greatly appreciated!
The code I use is below.
Many thanks in advance!!!
Bart
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>Charts</title>
<link href="site.css" rel="stylesheet">
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<nav id="nav01"></nav>
<div id="main">
<h1>This is a nice chart</h1>
<div id="container" style="width:100%; height:400px;"></div>
<script>
$(function () {
$('#container').highcharts({
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>
<footer id="foot01"></footer>
</div>
<script src="script.js"></script>
</body>
</html>