All Components

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

ASP.NET MVC Area Charts Local Data Binding

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
  • Change Theme
    default
    Default Theme
    • Main
    • Main Dark
    • Nordic
    • Ocean Blue
    • Ocean Blue A11Yaccessibility
    • Purple
    • Turquoise
    Bootstrap Theme
    • Main
    • Bootstrap 3
    • Bootstrap 3 Dark
    • Main Dark
    • Nordic
    • Turquoise
    • Turquoise Dark
    • Urban
    • Vintage
    Material Theme
    • Main
    • Arctic
    • Lime Dark
    • Main Dark
    • Material 2
    • Material 2 Dark
    • Nova
    Classic Theme
    • Main
    • Green
    • Green Dark
    • Lavender
    • Lavender Dark
    • Main Dark
    • Metro
    • Metro Dark
    • Moonlight
    • Opal
    • Opal Dark
    • Silver
    • Silver Dark
    • Uniform
    Fluent Theme
    • Main
local_data_binding.cshtml
Local_Data_BindingController.cs

Also available for:

CLIENT-SIDE API SERVER-SIDE API

Description

TheTelerik UI for ASP.NET MVC Area 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 InternetUsers list located in the \Models\Chart\ChartDataRepository.cs file as a model. After that you should configure the data bound fields for the Series (series =>{series.Area(model => model.Value)}) and Category Axis (axis => axis.Categories(model => model.Year)) Note that the view has to be strongly typed so that the chart is able to load its data.

You can find additional information about how to utilize the data-binding capabilities of the MVC chart inthe Getting Started section of the product documentation.

Additional Apps

This Area Charts example is part of a unique collection of hundreds of ASP.NET MVC demos, with which you can see allTelerik ASP.NET MVC 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 theThemeBuilder.

Support & Learning Resources

Additional Resources