Skip to main content

ChartRangeControlClient.ItemsSource Property

Gets or sets the chart client’s data source.

Namespace: DevExpress.Xpf.Charts.RangeControlClient

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public object ItemsSource { get; set; }

Property Value

Type Description
Object

An object that represents the data source from which the chart client retrieves its data.

Remarks

The chart client can be bound to any object that implements the IEnumerable interface or its descendant (e.g., IList, ICollection). To bind a chart client, you should assign a data source to the ItemsSource property.

Example

This example demonstrates how to use the date-time chart client for a range control to display a chart with date-time data within the range control’s viewport.

In this example a date-time chart range control client is bound to a System.Collections.Generic.List containing DateTimeItem objects.

Each DateTimeItem object contains Argument and Value properties, to which a date-time chart range control client is bound via its ChartRangeControlClient.ArgumentDataMember and ChartRangeControlClient.ValueDataMember properties.

See also:

Imports System
Imports System.Collections.Generic
Imports System.Windows

Namespace DateTimeChartRangeControlClient

    Public Class DateTimeItem
        Public Property Argument() As Object
        Public Property Value() As Object
    End Class

    Partial Public Class MainWindow
        Inherits Window

        Private Const dataCount As Integer = 100
        Private data As New List(Of DateTimeItem)()

        Private Function GenerateDateTimeData() As List(Of DateTimeItem)
            Dim now As Date = Date.Now.Date
            Dim rand As New Random()
            Dim value As Double = 0
            For i As Integer = 0 To dataCount - 1
                now = now.AddDays(1)
                value += (rand.NextDouble() - 0.5)
                data.Add(New DateTimeItem() With {.Argument = now, .Value = value + Math.Sin(i * 0.6)})
            Next i
            Return data
        End Function

        Public Sub New()
            InitializeComponent()
            Me.DataContext = GenerateDateTimeData()
        End Sub
    End Class
End Namespace

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ItemsSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also