【发布时间】:2015-02-03 15:00:16
【问题描述】:
我正在尝试从here 运行一个示例,但它没有显示。在我的浏览器控制台中,错误出现在
行<script type="text/javascript">
$(function () {
$('#container').highcharts({
说undefined is not a function,而最后一行被下划线表示错误。
这是我从 .cshtml 页面运行脚本的方式。
<!DOCTYPE HTML><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highcharts Example</title>
</head>
<body>
<h1>Highcharts example</h1>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/modules/exporting.js"></script>
<script type="text/javascript">
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Column chart with negative values'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
credits: {
enabled: false
},
series: [{
name: 'John',
data: [5, 3, 4, 7, 2]
}, {
name: 'Jane',
data: [2, -2, -3, 2, 1]
}, {
name: 'Joe',
data: [3, 4, 4, -2, 5]
}]
});
});
</script>
</body></html>
【问题讨论】:
-
文档很可能已经过时了。尝试找到一个工作示例(jsfiddle、plunker 等)
标签: javascript jquery asp.net razor highcharts