MVC Shield Chart不会显示

时间:2015-01-05 09:28:12

标签: asp.net-mvc razor shieldui

我试图将MVC Shield图表添加到我当前正在工作的页面。 当我这样做时,页面仍在工作,但图表并没有显示出来。就像代码甚至不存在一样。

代码:

@using Shield.Mvc.UI;
@(Html.ShieldChart()
.Name("chart")
.Theme("light")
.AxisX(axis => axis
    .Title(title => title.Text("Budget"))
    .EndOffset(0.05f)
    .StartOffset(0.05f))
.AxisY(axis => axis
    .Title(title => title.Text("Revenue")))
.PrimaryHeader(header => header
    .Text("Ad Budget VS Revenue"))
 .ChartLegend(legend => legend
    .Align(Shield.Mvc.UI.Chart.Align.Center)
    .VerticalAlign(Shield.Mvc.UI.Chart.VerticalAlign.Top)
    .RenderDirection(Shield.Mvc.UI.Chart.Direction.Horizontal))
 .DataSeries(series => series
    .Bubble()
    .Name("TV Commercials")
    .Data(new object[]
    {
        new { x = 100000, y = 112000, size = 112000, pointName = "Poor" },
        new { x = 120000, y = 140000, size = 140000, pointName = "Low" },
        new { x = 140000, y = 200000, size = 200000, pointName = "Average" },
        new { x = 160000, y = 210000, size = 210000, pointName = "Good" },
        new { x = 180000, y = 217000, size = 217000, pointName = "Superb" }
    }))
.DataSeries(series => series
    .Bubble()
    .Name("Internet Advertising")
    .Data(new object[]
    {
        new { x = 100000, y = 90000, size = 90000, pointName = "Poor Performance" },
        new { x = 120000, y = 97000, size = 97000, pointName = "Low Performance" },
        new { x = 140000, y = 140000, size = 140000, pointName = "Average Performance" },
        new { x = 160000, y = 300000, size = 300000, pointName = "High Performance" },
        new { x = 180000, y = 400000, size = 400000, pointName = "Ideal Performance" }
    }))

)`

1 个答案:

答案 0 :(得分:0)

您是否已将更改添加到〜/ Views / Web.config 文件中,并包含了ShieldUI的JavaScript和CSS资源,如下页所述:

https://www.shieldui.com/documentation/aspnet.mvc.chart/quickstart