kendo chart series defaults

2019-09-09 21:37发布

I have a kendo chart and i have to binding the chart using model. I have to set the series defaults option.

i got the code how to set the seriesdefualts in javascrit.Can someone help me how to add the same in model view binding.

javascript:

seriesDefaults: { overlay: { gradient: null }

Model view Binding:

 @(Html.Kendo().Chart(Model.ReportDataList)
     .Name("chartProjPer")
     .Title(title => title
         .Text("% by Projects")
         .Position(ChartTitlePosition.Top)
     )
     .Legend(legend => legend
         .Visible(true)
         .Position(ChartLegendPosition.Right)
     )
     .Tooltip(t => t.Visible(true)
         .Template("${ category } (${ value }%)")
     )
     .Series(series => series.Pie(Model.ReportDataList)
         .CategoryField("ReportBy")
         .Field("ProjPercentage")
         .Labels(l => l.Visible(true)
             .Template("${ category } (${ value }%)")
         )
         .StartAngle(180)
     )
 )

1条回答
Juvenile、少年°
2楼-- · 2019-09-09 21:58

Try something like this:

.SeriesDefaults(seriesDefaults =>
    seriesDefaults.Pie().Overlay(ChartPieSeriesOverlay.None)
)

API Doc: http://docs.telerik.com/kendo-ui/api/aspnet-mvc/Kendo.Mvc.UI.Fluent/ChartPieSeriesBuilder#methods-Overlay(Kendo.Mvc.UI.ChartPieSeriesOverlay)

查看更多
登录 后发表回答