Jquery 图表不可见

Jquery 图表不可见,jquery,asp.net,highcharts,Jquery,Asp.net,Highcharts,我尝试使用HighCharts,但无法显示它。我应该提到我正在使用.NETMVC+引导。我正在为我的页面使用布局。不知怎么的,图表没有显示出来。我不知道如何做一个布局页面的小提琴对不起 这是我的布局页面: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=ed

我尝试使用HighCharts,但无法显示它。我应该提到我正在使用.NETMVC+引导。我正在为我的页面使用布局。不知怎么的,图表没有显示出来。我不知道如何做一个布局页面的小提琴对不起

这是我的布局页面:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Test</title>

    <!-- Bootstrap core CSS -->
    <link href="~/Content/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="~/Content/cover.css" rel="stylesheet">
    <link href="~/Content/Site.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="~/Scripts/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

    <div class="site-wrapper">

        <div class="site-wrapper-inner">

            <div class="cover-container">

                <div class="masthead clearfix">
                    <div class="inner">
                        <h3 class="masthead-brand">Test</h3>
                        <nav>
                            <ul class="nav masthead-nav">
                                <li><a href="/Home">Startpagina</a></li>
                                <li><a href="#">Contact</a></li>
                            </ul>
                        </nav>
                    </div>
                </div>
                @RenderBody()
                <div class="mastfoot">
                    <div class="inner">
                        <p>Test</p>
                    </div>
                </div>

            </div>

        </div>

    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="~/Scripts/ie10-viewport-bug-workaround.js"></script>
</body>
</html>

试验
试验
@RenderBody() 试验

这是实际页面:

    <div class="panel panel-default">
    <div id="chart_panel"
         style="width:100%;height:314px"></div>
</div>
<script src="http://code.highcharts.com/highcharts.js"></script>

<script>
    $(function () {
        $('#chart_panel').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>

$(函数(){
$(“#图表"面板”)。高图({
图表:{
类型:'bar'
},
标题:{
正文:“水果消费”
},
xAxis:{
类别:[‘苹果’、‘香蕉’、‘橙子’]
},
亚克斯:{
标题:{
文字:“吃水果”
}
},
系列:[{
姓名:'简',
数据:[1,0,4]
}, {
姓名:'约翰',
数据:[5,7,3]
}]
});
});

将脚本放在页面顶部,如下所示


//在你的头标签上写上两行
更新


因为观察到控制台错误,所以未定义jquery。在您的页面上定义一次,并删除所有重复的包含。

在您使用的JSFIDLE中

$('#container').highcharts
相反,您必须传递div
chart\u面板的id

$('#chart_panel').highcharts
并将脚本添加到外部资源中,这意味着将其添加到head标记中

JSFIDLE工作示例:

小提琴坏了。这些资源不应包含在
标记中。当版面有jquery时,你为什么还要在页面上再次添加它?不管怎样,我忽略了这一点。我为我原来的帖子所做的更改感到抱歉。从一开始我就应该更清楚。@许多问题您是否注意到任何浏览器控制台错误??很好。我刚刚注意到我有以下错误:TypeError:highchartsdapter是未定义的highcharts.js:306:425 ReferenceError:$未定义您应该编辑控制台错误的答案。我就这样把它修好了。
$('#chart_panel').highcharts