剑道图“.MajorUnit()”来自控制器端

时间:2016-01-01 12:35:21

标签: asp.net-mvc-4 kendo-chart

我无法从控制器端绑定“.MajorUnit”值。我google了很多,但找不到正确的答案。我给了静态值“100”(.MajorUnit(100)),即好。但是如何绑定从控制器返回的动态值,如.MajorUnit(ViewBag.MyCountValue)。

@(Html.Kendo().Chart<ExtractorWiseExtractionCount>()
        .Name("userchart")
        .HtmlAttributes(new { style = "width: 100%; height:150pxpx", id = "ExtDataChart_" + extid })
         //.Title("Extraction Details")
        .Legend(legend => legend
        .Position(ChartLegendPosition.Top)
        )
        .DataSource(ds => ds.Read(read => read.Action("GetExtractionCount", "DashboardStatistics", new { allotId = allotId, extid = extid })))
        .Series(series =>
        {
            series.Line(model => model.ExtCompletedCount).Name("Allocation Wise Extraction");
            series.Line(model => model.IssueReportedCount).Name("Issue Reported");
        })
        .CategoryAxis(axis => axis
        .Categories(model => model.ExtractionDate).Visible(false)
        .Labels(labels => labels.Rotation(-40))
        .Crosshair(c => c.Visible(true))
        )
        .ValueAxis(axis => axis.Numeric()
        .Labels(labels => labels.Format("{0:N0}"))
        .MajorUnit(100)
        )
        .Tooltip(tooltip => tooltip
        .Visible(true)
        .Shared(true)
        .Format("{0:N0}")
        )
     )

0 个答案:

没有答案