简体   繁体   English

引用Shield UI ASP.NET MVC javascript模块

[英]Referencing the Shield UI ASP.NET MVC javascript modules

I am creating an MVC ASP.NET project and am using Shield UI MVC chart. 我正在创建一个MVC ASP.NET项目,并且正在使用Shield UI MVC图表。 I have added references to the trial packages I downloaded and have inserted the sample demo code that is available online: https://demos.shieldui.com/mvc/pie-chart/basic-usage 我添加了对我下载的试用版软件包的引用,并插入了在线提供的示例演示代码: https : //demos.shieldui.com/mvc/pie-chart/basic-usage

@(Html.ShieldChart()
.Name("chart")
.Theme(Response.Cookies.Theme())
.Export(false)
.PrimaryHeader(header => header.Text("Browsers Popularity amongst Users"))
.ChartLegend(legend=>legend.Enabled(true))
.SeriesSettings(setting=>setting.Pie(pie=>pie
    .EnablePointSelection(true)))
.Tooltip(tooltip=>tooltip.CustomPointText("{point.collectionAlias}: {point.y}"))        
.DataSeries(dataSeries => dataSeries.Pie()
    .CollectionAlias("Usage")
    .Data(new object[] 
    {
        new object[] {"Firefox", 44.2}, 
        new object[] {"IE7", 26.6}, 
        new object[] {"IE6", 20}, 
        new object[] {"Chrome", 3.1}, 
        new object[] {"Other", 5.4}           
    }))   

) Only the statement: )仅声明:

.Theme(Response.Cookies.Theme())

invoked an error, but I removed the line, since I need to get started first. 调用了一个错误,但是我删除了该行,因为我需要先开始。

Since I am quite new to MVC I can't figure out where I could place the following lines of code: 由于我是MVC的新手,所以我不知道可以在哪里放置以下代码行:

<head >
<link rel="stylesheet" type="text/css" href="css/shieldchart.css" />
<script src="js/jquery-1.9.1.min.js" type="text/javascript">//</script>
<script src="js/shield-chart.all.min.js" type="text/javascript">//</script>

</head>

since I see nowhere a suitable place. 因为我找不到合适的地方。 I have Index.cshtml and About.cshtm files in the project, however there is no element I could place the lines… 我在项目中有Index.cshtml和About.cshtm文件,但是没有可以放置这些行的元素…

I think what you are looking for is the common _Layout.cshtml 我认为您正在寻找的是常见的_Layout.cshtml

Should be located in the Views\\Shared folder. 应该位于Views\\Shared文件夹中。

You can learn more about how views are structured and work on the ASP.net website . 您可以在ASP.net网站上了解有关视图的结构和工作方式的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM