New to Telerik UI for ASP.NET MVC? Start a free 30-day trial
Bind Chart to Dynamic Series
Environment
Product | Telerik UI for ASP.NET MVC Chart |
Product Version | Created with version 2024.4.1112 |
Description
How can I bind the Chart to dynamic series?
Example
Razor
@model TelerikAspNetCoreApp4.Models.MyViewModel
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series => {
foreach (var def in Model.Series) {
series.Column(def.Data).Name(def.Name).Stack(def.Stack);
}
})
.CategoryAxis(axis => axis
.Categories(new string[] { "A", "B", "C" })
)
)
To see the complete example, refer to the ASP.NET MVC application in the UI for ASP.NET MVC Examples repository.