【发布时间】:2014-03-07 02:05:42
【问题描述】:
我目前尝试仅实现来自 highcharts 的示例,只是为了感受一下并尝试一下,但它似乎不起作用。我尝试加载他们的独立框架,不同版本的 jQuery,但图表不会呈现。这是我的代码:
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<script type="text/javascript">
var chart = new Highcharts.Chart({
chart: {
//alignTicks: false,
type: 'line',
renderTo: 'container'
},
$(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>
<div id="container" style="width:100%; height:400px;"></div>
</body>
</html>
提前致谢。
【问题讨论】:
-
图表不渲染。
-
它说“SyntaxError: missing : after property id $(function () {” 但我不确定这是什么意思
-
现在我得到“未捕获的异常:Highcharts 错误 #13:www.highcharts.com/errors/13”
-
我仍然收到错误 13。这是我的确切代码 d.pr/i/NLeM
-
还是什么都没有。同样的错误
标签: javascript jquery highcharts graphing