Back to Devexpress

NumericChartRangeControlClient Class

wpf-devexpress-dot-xpf-dot-charts-dot-rangecontrolclient-14c03da5.md

latest5.9 KB
Original Source

NumericChartRangeControlClient Class

Shows a numeric data within the range control’s viewport.

Namespace : DevExpress.Xpf.Charts.RangeControlClient

Assembly : DevExpress.Xpf.Charts.v25.2.dll

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
[DXLicenseWpf]
public class NumericChartRangeControlClient :
    ChartRangeControlClient
vb
<DXLicenseWpf>
Public Class NumericChartRangeControlClient
    Inherits ChartRangeControlClient

Remarks

To display numeric data within a RangeControl, you need to assign a NumericChartRangeControlClient instance to the RangeControl.Client property.

Example

This example demonstrates how to set up a range control with the numeric chart client to display a chart with numeric data in the range control’s background.

Usually, in order to provide data to a chart numeric range control client, you need to specify a datasource using the ChartRangeControlClient.ItemsSource property and specify the required data fields via ChartRangeControlClient.ArgumentDataMember and ChartRangeControlClient.ValueDataMember properties (for more information, see the How to: Bind a Numeric Chart Range Control Client to a List of Custom Objects example). Note that when the ArgumentDataMember property is specified, chart points are sorted by arguments in the ascending order.

In the current example, a numeric chart client is bound to an array of integers using the ItemsSource property. In addition, you can bind a numeric chart client to other simple type objects (short, integer, long, double, decimal, float types , etc.). In this scenario the data values are shown in the same order in which elements have been added to the array.

vb
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Windows

Namespace NumericRangeControlClient

    Partial Public Class MainWindow
        Inherits Window

        Private dataArray() As Integer = { 0, 4, 2, 5, 4, 5, 3, 4, 8, 9, 10 }

        Public Sub New()
            InitializeComponent()
            DataContext = dataArray
        End Sub
    End Class
End Namespace
xaml
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       
        xmlns:Custom="http://schemas.devexpress.com/winfx/2008/xaml/charts/rangecontrolclient"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
        xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="NumericRangeControlClient.MainWindow"
        Title="MainWindow" Height="350" Width="525" >

    <Grid>
        <dxe:RangeControl Margin="20,5" ShowNavigationButtons="True" ShowRangeBar="True">
            <Custom:NumericChartRangeControlClient ItemsSource="{Binding}"
                GridSpacing="1" GridAlignment="1">
                <Custom:NumericChartRangeControlClient.View>
                    <Custom:RangeControlClientBarView/>
                </Custom:NumericChartRangeControlClient.View>
            </Custom:NumericChartRangeControlClient>
        </dxe:RangeControl>
    </Grid>
</Window>
csharp
using System;
using System.Collections.Generic;
using System.Windows;

namespace NumericRangeControlClient {

    public partial class MainWindow : Window {

        int[] dataArray = new int[] { 0, 4, 2, 5, 4, 5, 3, 4, 8, 9, 10 };

        public MainWindow() {
            InitializeComponent();
            DataContext = dataArray;
        }
    }
}

Implements

IRangeControlClient

Inheritance

Show 12 items

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control ChartElementBase ChartElement ChartRangeControlClientBase ChartRangeControlClient NumericChartRangeControlClient

See Also

NumericChartRangeControlClient Members

DevExpress.Xpf.Charts.RangeControlClient Namespace