【问题标题】:Highcharts dont show: "undefined is not a function"Highcharts 不显示:“未定义不是函数”
【发布时间】: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


【解决方案1】:

适用于我最新的 Chrome、Firefox 和 IE

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-03
    • 1970-01-01
    • 2014-06-04
    • 2016-10-04
    • 2015-06-27
    • 2018-05-14
    相关资源
    最近更新 更多