Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Bind Series to View Models Using the Item Template

  • 4 minutes to read

This example demonstrates how to bind series view models to a chart. Note that you can bind secondary axes and custom labels using the same approach.

To bind series view models to a chart, use the Diagram.SeriesItemsSource property. To configure how the series view model is converted to a series on a chart, use Diagram.SeriesItemTemplate or Diagram.SeriesItemTemplateSelector. In this example, the Template is used to generate identical series.

View Example

Public Class GdpSeries
    Public Property CountryName() As String
    Public Property Values() As IEnumerable(Of Gdp)
End Class

Public Class Gdp
    Public Property Year() As Integer
    Public Property Value() As Double
End Class