2012-12-06 41 views
0

我正在寻找具有爆炸部分的饼图的C#或VB Razor语法的示例。我不结合各个字段,我使用类似...Kendo UI ASP.Net饼图爆炸部分

.Series(Sub(series) 
     series.Pie(Function(model) model.Id, Function(model) model.PriorityName).Overlay(ChartPieSeriesOverlay.None) 
End Sub) _ 

回答

0

通过从Telerik的支持,演示和支持,我已经想通了这个问题。希望这有助于某一天。我添加了另一个参数给我的ViewModel,如果我想让图表的一部分爆炸,它只是传递一个布尔值。然后我将它作为Model.Explosion传递到下面的代码中。

@(Html.Kendo().Chart(Of Core.UI.PieChartViewModel) _ 
     .Name("Chart_OpenItemsByPM") _ 
     .ChartArea(Function(c) c.Background("#fff")) _ 
     .HtmlAttributes(New With {.Style = "height:280px;width:90%;margin:0px auto;"}) _ 
     .Legend(Function(legend) legend.Position(ChartLegendPosition.Bottom)) _ 
     .DataSource(Function(ds) ds.Read(Function(r) r.Action("Chart_OpenItemsByPM", "Dashboard"))) _ 
     .Series(Sub(series) 
         series.Pie(Function(model) model.Id, Function(model) model.Priority 

Name, Nothing, Function(model) model.Explosion).Overlay(ChartPieSeriesOverlay.None) 
        End Sub) _ 
      .SeriesColors("#c72e15", "#c78215", "#c7c115", "#156dc7") _ 
      .Tooltip(Function(tooltip) tooltip.Visible(True).Format("{0} Tickets")) 
     )