问题
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