wpf-devexpress-dot-xpf-dot-charts-dot-boxplotseries2d-4b044828.md
Gets or sets the name of the data field that contains the “Min” values for the Box Plot series.
Namespace : DevExpress.Xpf.Charts
Assembly : DevExpress.Xpf.Charts.v25.2.dll
NuGet Package : DevExpress.Wpf.Charts
public string MinValueDataMember { get; set; }
Public Property MinValueDataMember As String
| Type | Description |
|---|---|
| String |
A string value that specified the data field name.
|
This example shows how to create a Box Plot chart:
Create a ChartControl and specify its ChartControl.Diagram property to a XYDiagram2D object. Note that the ChartControl.Diagram is a content property. You can declare a diagram in XAML directly after a chart control’s declaration without wrapping it in opening and closing ChartControl.Diagram tags.
Add a BoxPlotSeries2D object to the Diagram.Series collection. Note that the Diagram.Series is a content property. You can declare series in XAML directly after a diagram’s declaration without wrapping them in opening and closing Diagram.Series tags.
Use the following properties to bind the series to data:
The following properties allow you to customize the Box Plot chart appearance:
Markup:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BoxPlotChart"
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
x:Class="BoxPlotChart.MainWindow"
mc:Ignorable="d"
Title="MainWindow" Height="600" Width="800">
<Window.DataContext>
<local:ChartViewModel/>
</Window.DataContext>
<Grid>
<dxc:ChartControl>
<dxc:ChartControl.Legends>
<dxc:Legend HorizontalPosition="Left"/>
</dxc:ChartControl.Legends>
<dxc:XYDiagram2D>
<dxc:BoxPlotSeries2D DataSource="{Binding Data}"
DisplayName="Box Plot"
ArgumentDataMember="Argument"
MinValueDataMember="Min"
MaxValueDataMember="Max"
Quartile1ValueDataMember="Quartile1"
Quartile3ValueDataMember="Quartile3"
MedianValueDataMember="Median"
MeanValueDataMember="Mean"
OutlierValuesDataMember="Outliers"
CapWidthPercentage="50"
BoxWidth="0.8">
<dxc:BoxPlotSeries2D.Model>
<dxc:SimpleBoxPlot2DModel/>
</dxc:BoxPlotSeries2D.Model>
</dxc:BoxPlotSeries2D>
<dxc:XYDiagram2D.AxisX>
<dxc:AxisX2D TickmarksMinorVisible="False"/>
</dxc:XYDiagram2D.AxisX>
</dxc:XYDiagram2D>
</dxc:ChartControl>
</Grid>
</Window>
Code-Behind:
using System.Collections.ObjectModel;
using System.Windows;
namespace BoxPlotChart {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
}
public class ChartViewModel {
public Collection<DataPoint> Data { get { return DataPoint.GetDataPoints(); } }
public class DataPoint {
public string Argument { get; set; }
public double Min { get; set; }
public double Max { get; set; }
public double Quartile1 { get; set; }
public double Quartile3 { get; set; }
public double Median { get; set; }
public double Mean { get; set; }
public double[] Outliers { get; set; }
public DataPoint(string argument, double min, double max, double q1, double q3, double median, double mean, double[] outliers) {
this.Argument = argument;
this.Min = min;
this.Max = max;
this.Quartile1 = q1;
this.Quartile3 = q3;
this.Median = median;
this.Mean = mean;
this.Outliers = outliers;
}
public static Collection<DataPoint> GetDataPoints() {
Collection<DataPoint> data = new Collection<DataPoint> {
new DataPoint("June", 46, 94, 64, 76, 70, 73, new double[]{ 30, 96.3, 99.56 }),
new DataPoint("July", 33, 121, 66, 88, 77, 75, new double[]{ 20, 22, 132.7 }),
new DataPoint("August", 10, 90, 40, 60, 50, 55, new double[]{ 4, 5, 95.4, 99.3, 109 })
};
return data;
}
}
}
}
Imports System.Collections.ObjectModel
Imports System.Windows
Namespace BoxPlotChart
Public Partial Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
End Class
Public Class ChartViewModel
Public ReadOnly Property Data As Collection(Of DataPoint)
Get
Return DataPoint.GetDataPoints()
End Get
End Property
Public Class DataPoint
Public Property Argument As String
Public Property Min As Double
Public Property Max As Double
Public Property Quartile1 As Double
Public Property Quartile3 As Double
Public Property Median As Double
Public Property Mean As Double
Public Property Outliers As Double()
Public Sub New(ByVal argument As String, ByVal min As Double, ByVal max As Double, ByVal q1 As Double, ByVal q3 As Double, ByVal median As Double, ByVal mean As Double, ByVal outliers As Double())
Me.Argument = argument
Me.Min = min
Me.Max = max
Me.Quartile1 = q1
Me.Quartile3 = q3
Me.Median = median
Me.Mean = mean
Me.Outliers = outliers
End Sub
Public Shared Function GetDataPoints() As Collection(Of DataPoint)
Dim data As Collection(Of DataPoint) = New Collection(Of DataPoint) From {
New DataPoint("June", 46, 94, 64, 76, 70, 73, New Double() {30, 96.3, 99.56}),
New DataPoint("July", 33, 121, 66, 88, 77, 75, New Double() {20, 22, 132.7}),
New DataPoint("August", 10, 90, 40, 60, 50, 55, New Double() {4, 5, 95.4, 99.3, 109})
}
Return data
End Function
End Class
End Class
End Namespace
See Also