kendo chart series defaults

孤街浪徒 提交于 2019-12-25 14:13:41

问题


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:


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)



来源:https://stackoverflow.com/questions/32524690/kendo-chart-series-defaults

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!