New to Telerik UI for ASP.NET Core? Download free 30-day trial

ASP.NET Core Pie Charts Local Data Binding

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
HtmlHelper
TagHelper
Files:
local_data_binding.cshtml
Local_Data_BindingController.cs
ElectricitySource.cs
Local_Data_Binding_TagHelper.cshtml
ChartDataRepository.cs

Also available for:

CLIENT-SIDE API SERVER-SIDE API

Description

The Telerik UI for ASP.NET Core Pie chart can be instructed to display data from local data storage using its built-in data-binding capabilities.

There are two ways to bind the chart:

  • Server - the chart will bind to a supplied model
  • Ajax - the chart will perform Ajax requests to populate its series.

In this example you can see how to bind the chart using the server approach. You need to create an action method and pass the SpainElectricityBreakdown enumerator located in the \Models\Chart\ChartDataRepository.cs file as a model. After that you should configure the data bound Percentage, Source and Explode fields for the Series. Note that the view has to be strongly typed so that the chart is able to load its data.

Additional Apps

This Pie Charts example is part of unique collection of hundreds of ASP.NET Core demos, with which you can see all Telerik ASP.NET Core components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Telerik REPL for ASP.NET Core or ThemeBuilder.

Support & Learning Resources

Additional Resources