我正在尝试将我的剑道条形图的主题设置为“metro”主题,但除非我在剃刀代码中明确声明它,否则似乎无法做到。
我希望下面的代码可以工作,但不知何故,渲染的条形图使用默认主题。
<link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.metro.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.dataviz.metro.min.css" rel="stylesheet" type="text/css">
<script src="http://cdn.kendostatic.com/2012.3.1114/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2012.3.1114/js/kendo.all.min.js"></script>
<script src="http://cdn.kendostatic.com/2012.3.1114/js/kendo.aspnetmvc.min.js"></script>
<section id="content">
<div class="row-fluid">
@RenderBody()
@(Html.Kendo().Chart()
.Name("chart")
.Title("Internet Users")
.Series(series => {
series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
})
.CategoryAxis(axis => axis
.Categories("2005", "2006", "2007", "2008", "2009")
)
.ValueAxis(axis => axis
.Numeric().Labels(labels => labels.Format("{0}%"))
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0}%")
)
)
</div>
</section>
但这很有效。
@(Html.Kendo().Chart()
.Name("chart")
.Title("Internet Users")
.Series(series => {
series.Bar(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
series.Bar(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
})
.CategoryAxis(axis => axis
.Categories("2005", "2006", "2007", "2008", "2009")
)
.ValueAxis(axis => axis
.Numeric().Labels(labels => labels.Format("{0}%"))
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0}%")
)
.Theme("metro")
)