0

我正在尝试将 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" }
    }))

)`

4

1 回答 1

0

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

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

于 2015-01-13T21:52:57.117 回答