我刚刚使用php
创建了highcharts
页面。我按照他们网站上的说明进行操作,最终无法使用图表。我不知道图表不起作用的原因是什么。同样关于jq.js,即jquery.js,我刚刚将其重命名。
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="jschart/jq.js"></script>
<script src="jschart/jschart.js"></script>
<script src="jschart/esporting.js"></script>
<script type="text/javascript">
$(function () {
$('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>
</head>
<body background="http://www.footpatrol.co.uk/templates/footpatrol.co.uk/_images//blog/_2013/adidas-Rick-Owens-Tech-Runner/adidas-Rick-Owens-Tech-Runner-10.jpg" >
<div id ="content">
<div id="container" style="width:100%; height:400px;">asdf</div>
<div style="width:100%" >
<table class="tablename" border="2" style="margin: auto">
<tr style="font-size:30px">
<th>NCFS</th>
<th>NFCL</th>
<th>MICROTOP</th>
<th>SONION</th>
<th>ZAMA</th>
<th>TOYOTA</th>
</tr>
<tr><td>asdfasdf</td>
<td>asdfasdf</td>
<td>asdfasdf</td>
<td>asdfasdf</td>
<td>asdfasdf</td>
<td>asdfasdf</td>
</tr>
</table>
</div>
</div>
</center>
</body>
</html>
最佳答案
我不确定jq.js
是否是jquery库。如果不是,则包含jquery library
$('container')
应该是$('#container')