【发布时间】:2016-11-18 09:31:35
【问题描述】:
我刚刚使用highcharts 创建了一个php 页面。我按照他们网站上的说明进行操作,最终无法使用图表。我不知道我的图表不起作用的原因是什么。还有关于 jquery.js 的 Jq.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>
【问题讨论】:
-
你检查过控制台吗?
-
你缺少一个哈希值,应该是
$('#container')({... -
哦,我检查了它
-
仍然无法工作@Azola
-
@EarvinNillCastillo 初始化函数应该在
document.ready函数中
标签: php html css charts highcharts