Back to Devexpress

Series.ValueDataMember Property

wpf-devexpress-dot-xpf-dot-charts-dot-series-e134898b.md

latest7.2 KB
Original Source

Series.ValueDataMember Property

Gets or sets the name of the data field which contains values for generated series points.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public string ValueDataMember { get; set; }
vb
Public Property ValueDataMember As String

Property Value

TypeDescription
String

A String value that specifies the data field name.

|

Remarks

Use the Series.ArgumentDataMember and ValueDataMember properties to bind a series to data. For more information, refer to Bind a Series to a Data Source.

Example

The following example demonstrates how to bind a DXCharts control to an MDB database.

To accomplish this, it is necessary to add a corresponding DataSet to a project, and set the Series.ArgumentScaleType, Series.ArgumentDataMember, Series.ValueScaleType and Series.ValueDataMember properties to the required values.

Then, in a code-behind the Window.Initialize method, you can obtain all data from a DataSet, using the data adapter’s GetData method, and assign this data to a series’ Series.DataSource property.

xaml
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" Title="Window1" Height="300" Width="396">
    <Grid>
        <dxc:ChartControl Name="chartControl1">
            <dxc:ChartControl.Diagram>
                <dxc:XYDiagram2D>
                    <dxc:XYDiagram2D.Series>
                        <dxc:BarSideBySideSeries2D Name="carSeries" ArgumentDataMember="Model" ValueDataMember="Price" />
                    </dxc:XYDiagram2D.Series>
                </dxc:XYDiagram2D>
            </dxc:ChartControl.Diagram>
        </dxc:ChartControl>
    </Grid>
</Window>
csharp
using System.Windows;

namespace WpfApplication1 {

    public partial class Window1 : Window {
        public Window1() {
            InitializeComponent();

            carSeries.DataSource = 
                new CarsDBDataSetTableAdapters.CarsTableAdapter().GetData();
        }
    }
}
vb
Imports Microsoft.VisualBasic
Imports System.Windows

Namespace WpfApplication1

    Partial Public Class Window1
        Inherits Window
        Public Sub New()
            InitializeComponent()

            carSeries.DataSource = _
                New CarsDBDataSetTableAdapters.CarsTableAdapter().GetData()
        End Sub
    End Class
End Namespace

The following code snippets (auto-collected from DevExpress Examples) contain references to the ValueDataMember 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.

wpf-bind-a-range-control-to-a-chart-control/CS/GoldPrices/MainWindow.xaml#L73

xml
ArgumentDataMember="Date"
                      ValueDataMember="Price"/>
</dxc:XYDiagram2D>

wpf-data-grid-display-chart-control-in-grid-details/CS/WpfApplication19/MainWindow.xaml#L23

xml
<dxc:SimpleDiagram2D.Series>
    <dxc:PieSeries2D ArgumentDataMember="Supplier" ValueDataMember="Quantity" LabelsVisibility="True">
        <dxc:PieSeries2D.PointOptions>

wpf-charts-create-real-time-chart/CS/RealtimeChartMVVM/MainWindow.xaml#L21

xml
ArgumentDataMember="Argument"
              ValueDataMember="Value" >
<dxc:SplineSeries2D.LastPoint>

wpf-pivot-grid-visualize-data-in-chart/CS/WpfPivotChart/MainWindow.xaml#L45

xml
<dxc:BarSideBySideSeries2D ArgumentDataMember="Arguments"
                       ValueDataMember="Values"/>
</dxc:XYDiagram2D.SeriesTemplate>

wpf-data-grid-create-master-detail-grid-in-code/CS/MasterDetailInCode/MainWindow.xaml#L20

xml
<dxc:SimpleDiagram2D.Series>
    <dxc:PieSeries2D ArgumentDataMember="Supplier" ValueDataMember="Quantity" LabelsVisibility="True">
        <dxc:PieSeries2D.PointOptions>

wpf-dashboard-how-to-obtain-clicked-item-data/CS/Dashboard_ClientDataCards_Wpf/MainWindow.xaml.cs#L83

csharp
series1.ValueDataMember = "Actual";
series2.ValueDataMember = "Target";

wpf-dashboard-how-to-obtain-clicked-item-data/VB/Dashboard_ClientDataCards_Wpf/MainWindow.xaml.vb#L72

vb
series1.ValueDataMember = "Actual"
series2.ValueDataMember = "Target"

See Also

DataSource

ArgumentDataMember

Series Class

Series Members

DevExpress.Xpf.Charts Namespace