# Calculate Summaries | WPF Controls | DevExpress Documentation

The Chart Control can apply a summary function to calculate data source value summaries and display them as [series points](/WPF/6340/controls-and-libraries/charts-suite/chart-control/series/series-points).

![](/WPF/images/chart-control/sum-summary-function.png)

- Summary vs Aggregation
- Apply a Summary Function
- Numeric, Time-Span and Date-Time Axis Specifics

## Summary vs Aggregation

[Aggregation](/WPF/16846/controls-and-libraries/charts-suite/chart-control/data-aggregation) is similar to summaries but the Chart Control queries and stores data in memory differently.

|  | Summary | Aggregation |
| --- | --- | --- |
| **Store Data** | Chart stores summarized values. | Chart stores raw data source values. |
| **Change Detail Level** | Chart re-loads data from the data source. | Chart re-calculates data in memory. |
| **Behave on Zoom** | Chart does not re-calculate aggregated values when it is zoomed. | Chart re-calculates value aggregates on each zoom level. |
| **Memory Consumption** | Low | High |

## Apply a Summary Function

- Initialize the [Series.Summary](/WPF/DevExpress.Xpf.Charts.Series.Summary) property with a new [Summary](/WPF/DevExpress.Xpf.Charts.Summary) object.
- Specify the [Summary.Function](/WPF/DevExpress.Xpf.Charts.Summary.Function) property. The following summary functions are available:

    - [AverageSummaryFunction](/WPF/DevExpress.Xpf.Charts.AverageSummaryFunction) (“AVERAGE”)
    - [CountSummaryFunction](/WPF/DevExpress.Xpf.Charts.CountSummaryFunction) (“COUNT”)
    - [MaxSummaryFunction](/WPF/DevExpress.Xpf.Charts.MaxSummaryFunction) (“MAX”)
    - [MinSummaryFunction](/WPF/DevExpress.Xpf.Charts.MinSummaryFunction) (“MIN”)
    - [SumSummaryFunction](/WPF/DevExpress.Xpf.Charts.SumSummaryFunction) (“SUM”)

      You can create summary functions if the predefined functions do not meet your requirements or a series type takes two or more value parameters (for example, the financial [Candle Stick](/WPF/6850/controls-and-libraries/charts-suite/chart-control/series/2d-series-types/financial-series/candle-stick) series).
- The “AVERAGE”, “MAX”, “MIN” and “SUM” functions require you to specify the [DataMemberSummaryFunction.ValueDataMember](/WPF/DevExpress.Xpf.Charts.DataMemberSummaryFunction.ValueDataMember) property. The Chart Control uses the [DataMemberSummaryFunction.ValueDataMember](/WPF/DevExpress.Xpf.Charts.DataMemberSummaryFunction.ValueDataMember) to calculate summary values even if the [Series.ValueDataMember](/WPF/DevExpress.Xpf.Charts.Series.ValueDataMember) property is set.

You can use Chart Designer or markup to apply a summary function.

Important

Automatic summary functions can be calculated only for [Series](/WPF/6339/controls-and-libraries/charts-suite/chart-control/series/series) that operate with [data points](/WPF/6340/controls-and-libraries/charts-suite/chart-control/series/series-points) with **one** value for each argument. If series data points have **two** or more values (e.g., [Range](/WPF/10632/controls-and-libraries/charts-suite/chart-control/series/2d-series-types/bar-series/side-by-side-range-bar), [Financial](/WPF/8351/controls-and-libraries/charts-suite/chart-control/series/2d-series-types/financial-series) and [Bubble](/WPF/5870/controls-and-libraries/charts-suite/chart-control/series/2d-series-types/point-line-and-bubble-series/bubble) series), you should use Custom Summary Functions instead.

Also note that a summary function cannot be calculated when an axis’s [scale mode](/WPF/115179/controls-and-libraries/charts-suite/chart-control/axes/axis-scale-types) is **Continuous**.

### Use the Chart Designer

- Run the [Chart Designer](/WPF/17445/controls-and-libraries/charts-suite/chart-control/chart-designer-for-developers).
- Use the Element Tree on the left to select a series. Then, open its **Properties** tab on the right.
- Click the **Summary** property’s [button](/WPF/15631/controls-and-libraries/property-grid/visual-elements/grid-menus) and select the **New Summary** item.

      ![](/WPF/images/chart-control/summary-function-designer-add-new.png)
- Use the **Function** property menu to select a summary function.

      ![](/WPF/images/chart-control/summary-function-select-summary-function.png)
- Type a name of the data source field that provides data for summarization.

      ![](/WPF/images/chart-control/summary-function-value-data-member.png)
- Click the **Save and Exit** button to save changes and close the designer.

### Use Markup

The following example shows how to apply the “SUM” function:

- XAML
- C#
- VB.NET

<section id="tabpanel_l2uC1mkQLJ_tabid-xaml-1" role="tabpanel" data-tab="tabid-xaml-1">
<pre><code class="lang-xaml">&lt;Window.DataContext&gt;
    &lt;local:ChartViewModel/&gt;
&lt;/Window.DataContext&gt;
&lt;Grid&gt;
    &lt;dxc:ChartControl&gt;
        &lt;dxc:XYDiagram2D SeriesItemsSource=&quot;{Binding SaleSeries}&quot;&gt;
            &lt;dxc:XYDiagram2D.SeriesItemTemplate&gt;
                &lt;DataTemplate&gt;
                    &lt;dxc:PointSeries2D DataSource=&quot;{Binding Values}&quot;
                                       ArgumentDataMember=&quot;Category&quot;&gt;
                        &lt;!-- Configure the summary function options. --&gt;
                        &lt;dxc:PointSeries2D.Summary&gt;
                            &lt;dxc:Summary&gt;
                                &lt;dxc:Summary.Function&gt;
                                    &lt;dxc:SumSummaryFunction ValueDataMember=&quot;Value&quot;/&gt;
                                &lt;/dxc:Summary.Function&gt;
                            &lt;/dxc:Summary&gt;
                        &lt;/dxc:PointSeries2D.Summary&gt;
                        &lt;!--...--&gt;
                        &lt;dxc:PointSeries2D.Label&gt;
                            &lt;dxc:SeriesLabel Visible=&quot;True&quot; 
                                             TextPattern=&quot;Sum: ${V}M&quot; 
                                             dxc:MarkerSeries2D.Angle=&quot;90&quot; 
                                             ResolveOverlappingMode=&quot;JustifyAroundPoint&quot;/&gt;
                        &lt;/dxc:PointSeries2D.Label&gt;
                    &lt;/dxc:PointSeries2D&gt;
                &lt;/DataTemplate&gt;
            &lt;/dxc:XYDiagram2D.SeriesItemTemplate&gt;
            &lt;!--...--&gt;
        &lt;/dxc:XYDiagram2D&gt;
        &lt;!--...--&gt;
    &lt;/dxc:ChartControl&gt;
&lt;/Grid&gt;
</code></pre></section>
<section id="tabpanel_l2uC1mkQLJ_tabid-csharp-1" role="tabpanel" data-tab="tabid-csharp-1" aria-hidden="true" hidden="hidden">
<pre><code class="lang-csharp">public class ChartViewModel {
    public IEnumerable&lt;SaleSeries&gt; SaleSeries { get; private set; }
    public ChartViewModel() {     
        SaleSeries = new Collection&lt;SaleSeries&gt; {
        new SaleSeries {
            Values = new Collection&lt;SaleInfo&gt; {
                new SaleInfo { Category= &quot;Video players&quot;, Region = &quot;Asia&quot;,          Value = 853},
                new SaleInfo { Category= &quot;Video players&quot;, Region = &quot;Australia&quot;,     Value = 321},
                new SaleInfo { Category= &quot;Video players&quot;, Region = &quot;Europe&quot;,        Value = 655},
                new SaleInfo { Category= &quot;Video players&quot;, Region = &quot;North America&quot;, Value = 1325},
                new SaleInfo { Category= &quot;Video players&quot;, Region = &quot;South America&quot;, Value = 653},

                new SaleInfo { Category= &quot;Automation&quot;, Region = &quot;Asia&quot;,          Value = 172},
                new SaleInfo { Category= &quot;Automation&quot;, Region = &quot;Australia&quot;,     Value = 255},
                new SaleInfo { Category= &quot;Automation&quot;, Region = &quot;Europe&quot;,        Value = 981D},
                new SaleInfo { Category= &quot;Automation&quot;, Region = &quot;North America&quot;, Value = 963D},
                new SaleInfo { Category= &quot;Automation&quot;, Region = &quot;South America&quot;, Value = 123D},

                new SaleInfo { Category= &quot;Monitors&quot;, Region = &quot;Asia&quot;,          Value = 1011D},
                new SaleInfo { Category= &quot;Monitors&quot;, Region = &quot;Australia&quot;,     Value = 359D},
                new SaleInfo { Category= &quot;Monitors&quot;, Region = &quot;Europe&quot;,        Value = 721D},
                new SaleInfo { Category= &quot;Monitors&quot;, Region = &quot;North America&quot;, Value = 565D},
                new SaleInfo { Category= &quot;Monitors&quot;, Region = &quot;South America&quot;, Value = 532D},

                new SaleInfo { Category= &quot;Projectors&quot;, Region = &quot;Asia&quot;,          Value = 998D},
                new SaleInfo { Category= &quot;Projectors&quot;, Region = &quot;Australia&quot;,     Value = 222D},
                new SaleInfo { Category= &quot;Projectors&quot;, Region = &quot;Europe&quot;,        Value = 865D},
                new SaleInfo { Category= &quot;Projectors&quot;, Region = &quot;North America&quot;, Value = 787D},
                new SaleInfo { Category= &quot;Projectors&quot;, Region = &quot;South America&quot;, Value = 332D},

                new SaleInfo { Category= &quot;Televisions&quot;, Region = &quot;Asia&quot;,          Value = 1356D},
                new SaleInfo { Category= &quot;Televisions&quot;, Region = &quot;Australia&quot;,     Value = 232D},
                new SaleInfo { Category= &quot;Televisions&quot;, Region = &quot;Europe&quot;,        Value = 1323D},
                new SaleInfo { Category= &quot;Televisions&quot;, Region = &quot;North America&quot;, Value = 1125D},
                new SaleInfo { Category= &quot;Televisions&quot;, Region = &quot;South America&quot;, Value = 865D}
            }
        }
    };
    }
}
public class SaleSeries {
    public IEnumerable&lt;SaleInfo&gt; Values { get; set; }
}
public class SaleInfo {
    public string Category { get; set; }
    public string Region { get; set; }
    public double Value { get; set; }
}
</code></pre></section>
<section id="tabpanel_l2uC1mkQLJ_tabid-vb-1" role="tabpanel" data-tab="tabid-vb-1" aria-hidden="true" hidden="hidden">
<pre><code class="lang-vb">Public Class ChartViewModel
    Public Property SaleSeries As IEnumerable(Of SaleSeries)

    Public Sub New()
        SaleSeries = New Collection(Of SaleSeries) From {
            New SaleSeries With {
                .Values = New Collection(Of SaleInfo) From {
                    New SaleInfo With { .Category = &quot;Video players&quot;, .Region = &quot;Asia&quot;, .Value = 853R },
                    New SaleInfo With { .Category = &quot;Video players&quot;, .Region = &quot;Australia&quot;, .Value = 321R },
                    New SaleInfo With { .Category = &quot;Video players&quot;, .Region = &quot;Europe&quot;, .Value = 655R },
                    New SaleInfo With { .Category = &quot;Video players&quot;, .Region = &quot;North America&quot;, .Value = 1325R },
                    New SaleInfo With { .Category = &quot;Video players&quot;, .Region = &quot;South America&quot;, .Value = 653R },
                    New SaleInfo With { .Category = &quot;Automation&quot;, .Region = &quot;Asia&quot;, .Value = 172R },
                    New SaleInfo With { .Category = &quot;Automation&quot;, .Region = &quot;Australia&quot;, .Value = 255R },
                    New SaleInfo With { .Category = &quot;Automation&quot;, .Region = &quot;Europe&quot;, .Value = 981R },
                    New SaleInfo With { .Category = &quot;Automation&quot;, .Region = &quot;North America&quot;, .Value = 963R },
                    New SaleInfo With { .Category = &quot;Automation&quot;, .Region = &quot;South America&quot;, .Value = 123R },
                    New SaleInfo With { .Category = &quot;Monitors&quot;, .Region = &quot;Asia&quot;, .Value = 1011R },
                    New SaleInfo With { .Category = &quot;Monitors&quot;, .Region = &quot;Australia&quot;, .Value = 359R },
                    New SaleInfo With { .Category = &quot;Monitors&quot;, .Region = &quot;Europe&quot;, .Value = 721R },
                    New SaleInfo With { .Category = &quot;Monitors&quot;, .Region = &quot;North America&quot;, .Value = 565R },
                    New SaleInfo With { .Category = &quot;Monitors&quot;, .Region = &quot;South America&quot;, .Value = 532R },
                    New SaleInfo With { .Category = &quot;Projectors&quot;, .Region = &quot;Asia&quot;, .Value = 998R },
                    New SaleInfo With { .Category = &quot;Projectors&quot;, .Region = &quot;Australia&quot;, .Value = 222R },
                    New SaleInfo With { .Category = &quot;Projectors&quot;, .Region = &quot;Europe&quot;, .Value = 865R },
                    New SaleInfo With { .Category = &quot;Projectors&quot;, .Region = &quot;North America&quot;, .Value = 787R },
                    New SaleInfo With { .Category = &quot;Projectors&quot;, .Region = &quot;South America&quot;, .Value = 332R },
                    New SaleInfo With { .Category = &quot;Televisions&quot;, .Region = &quot;Asia&quot;, .Value = 1356R },
                    New SaleInfo With { .Category = &quot;Televisions&quot;, .Region = &quot;Australia&quot;, .Value = 232R },
                    New SaleInfo With { .Category = &quot;Televisions&quot;, .Region = &quot;Europe&quot;, .Value = 1323R },
                    New SaleInfo With { .Category = &quot;Televisions&quot;, .Region = &quot;North America&quot;, .Value = 1125R },
                    New SaleInfo With { .Category = &quot;Televisions&quot;, .Region = &quot;South America&quot;, .Value = 865R }
                }
            }
        }
    End Sub
End Class

Public Class SaleSeries
    Public Property Values As IEnumerable(Of SaleInfo)
End Class

Public Class SaleInfo
    Public Property Category As String
    Public Property Region As String
    Public Property Value As Double
End Class
</code></pre></section>

The example above uses the following API members to configure summary calculations:

| Member | Description |
| --- | --- |
| [Series.Summary](/WPF/DevExpress.Xpf.Charts.Series.Summary) | Gets or sets the series data point summarization settings. |
| [Summary](/WPF/DevExpress.Xpf.Charts.Summary) | Stores the series data point summarize options. |
| [Summary.Function](/WPF/DevExpress.Xpf.Charts.Summary.Function) | Specifies the summary function that calculates data point values. |
| [DataMemberSummaryFunction.ValueDataMember](/WPF/DevExpress.Xpf.Charts.DataMemberSummaryFunction.ValueDataMember) | Gets or sets the data source field that provides data to be aggregated. |

### Create a Custom Summary Function

The following example shows how to create the “Standard Deviation (STDEV.P)” summary function and apply it to chart data:

- XAML
- C#
- VB.NET

<section id="tabpanel_l2uC1mkQLJ-1_tabid-xaml-1" role="tabpanel" data-tab="tabid-xaml-1">
<pre><code class="lang-xaml">&lt;Window.DataContext&gt;
    &lt;local:ChartViewModel/&gt;
&lt;/Window.DataContext&gt;
&lt;Grid&gt;
    &lt;dxc:ChartControl&gt;
        &lt;dxc:XYDiagram2D SeriesItemsSource=&quot;{Binding SaleSeries}&quot;&gt;
            &lt;dxc:XYDiagram2D.SeriesItemTemplate&gt;
                &lt;DataTemplate&gt;
                    &lt;dxc:PointSeries2D DataSource=&quot;{Binding Values}&quot;
                                       ArgumentDataMember=&quot;Category&quot;&gt;
                        &lt;!-- Configure the summary function options. --&gt;
                        &lt;dxc:PointSeries2D.Summary&gt;
                            &lt;dxc:Summary&gt;
                                &lt;dxc:Summary.Function&gt;
                                    &lt;local:StdDevSummaryFunction ValueDataMember=&quot;Value&quot;/&gt;
                                &lt;/dxc:Summary.Function&gt;
                            &lt;/dxc:Summary&gt;
                        &lt;/dxc:PointSeries2D.Summary&gt;
                        &lt;!--...--&gt;
                    &lt;/dxc:PointSeries2D&gt;
                &lt;/DataTemplate&gt;
            &lt;/dxc:XYDiagram2D.SeriesItemTemplate&gt;
            &lt;!--...--&gt;
        &lt;/dxc:XYDiagram2D&gt;
        &lt;!--...--&gt;
    &lt;/dxc:ChartControl&gt;
&lt;/Grid&gt;
</code></pre></section>
<section id="tabpanel_l2uC1mkQLJ-1_tabid-csharp-1" role="tabpanel" data-tab="tabid-csharp-1" aria-hidden="true" hidden="hidden">
<pre><code class="lang-csharp">public class StdDevSummaryFunction : DataMemberSummaryFunction {
    public override string Name { get { return &quot;STDEV&quot;; } }

    protected override SeriesPoint[] CreateSeriesPoints(Series series, object argument, string[] functionArguments, DataSourceValues[] values, object[] colors) {
        double[] amount = new double[values.Length];
        double sum = 0.0;
        for(int i = 0; i &lt; values.Length; i++) {
            amount[i] = Convert.ToDouble(values[i][functionArguments[0]]);
            sum += amount[i];
        }
        double averageAmount = sum / values.Length;
        double standardDeviationSquareSum = 0.0;
        for(int i = 0; i &lt; values.Length; i++) {
            double deviation = amount[i] - averageAmount;
            standardDeviationSquareSum += deviation * deviation;
        }
        SeriesPoint seriesPoint = new SeriesPoint() { Argument = argument.ToString(), Value = Math.Round(Math.Sqrt(standardDeviationSquareSum / values.Length), 2) };
        return new SeriesPoint[] { seriesPoint };
    }
}
</code></pre></section>
<section id="tabpanel_l2uC1mkQLJ-1_tabid-vb-1" role="tabpanel" data-tab="tabid-vb-1" aria-hidden="true" hidden="hidden">
<pre><code class="lang-vb">Public Class StdDevSummaryFunction
    Inherits DataMemberSummaryFunction
    Public Overrides ReadOnly Property Name As String
        Get
            Return &quot;STDDEV&quot;
        End Get
    End Property
    Protected Overrides Function CreateSeriesPoints(ByVal series As Series, ByVal argument As Object, ByVal functionArguments As String(), ByVal values As DataSourceValues(), ByVal colors As Object()) As SeriesPoint()
        Dim amount As Double() = New Double(values.Length - 1) {}
        Dim sum As Double = 0.0
        For i As Integer = 0 To values.Length - 1
            amount(i) = Convert.ToDouble(values(i)(functionArguments(0)))
            sum += amount(i)
        Next
        Dim averageAmount As Double = sum / values.Length
        Dim standardDeviationSquareSum As Double = 0.0
        For i As Integer = 0 To values.Length - 1
            Dim deviation As Double = amount(i) - averageAmount
            standardDeviationSquareSum += deviation * deviation
        Next
        Dim seriesPoint As SeriesPoint = New SeriesPoint() With {
            .Argument = argument.ToString(),
            .Value = Math.Round(Math.Sqrt(standardDeviationSquareSum / values.Length), 2)
        }
        Return New SeriesPoint() {seriesPoint}
    End Function
End Class
</code></pre></section>

## Numeric, Time-Span and Date-Time Axis Specifics

For numerical, time-span and date-time x-axis [scales](/WPF/115179/controls-and-libraries/charts-suite/chart-control/axes/axis-scale-types), the summary function aggregates data point values for each interval the **MeasureUnit** ([NumericSummaryOptions.MeasureUnit](/WPF/DevExpress.Xpf.Charts.NumericSummaryOptions.MeasureUnit), [TimeSpanSummaryOptions.MeasureUnit](/WPF/DevExpress.Xpf.Charts.TimeSpanSummaryOptions.MeasureUnit) or [DateTimeSummaryOptions.MeasureUnit](/WPF/DevExpress.Xpf.Charts.DateTimeSummaryOptions.MeasureUnit)) property specifies.

The following images illustrate how changes to the measurement unit affect point summaries:

![A summary function is not applied.](/WPF/images/chart-control/summary-not-applied.png)A summary function is not applied.

![\[\](xref:DevExpress.Xpf.Charts.AverageSummaryFunction) is applied. \[NumericSummaryOptions.MeasureUnit\](xref:DevExpress.Xpf.Charts.NumericSummaryOptions.MeasureUnit) = 1 ](/WPF/images/chart-control/summary-measurement-unit-1.png)[AverageSummaryFunction](/WPF/DevExpress.Xpf.Charts.AverageSummaryFunction) is applied. [NumericSummaryOptions.MeasureUnit](/WPF/DevExpress.Xpf.Charts.NumericSummaryOptions.MeasureUnit) = 1

![\[\](xref:DevExpress.Xpf.Charts.AverageSummaryFunction) is applied. \[NumericSummaryOptions.MeasureUnit\](xref:DevExpress.Xpf.Charts.NumericSummaryOptions.MeasureUnit) = 5 ](/WPF/images/chart-control/summary-measurement-unit-5.png)[AverageSummaryFunction](/WPF/DevExpress.Xpf.Charts.AverageSummaryFunction) is applied. [NumericSummaryOptions.MeasureUnit](/WPF/DevExpress.Xpf.Charts.NumericSummaryOptions.MeasureUnit) = 5

The following example shows how to change a measurement unit used to calculate numeric x-axis arguments:

- XAML
- C#
- VB.NET

<section id="tabpanel_l2uC1mkQLJ-2_tabid-xaml-1" role="tabpanel" data-tab="tabid-xaml-1">
<pre><code class="lang-xaml">&lt;Window.DataContext&gt;
    &lt;local:ChartViewModel/&gt;
&lt;/Window.DataContext&gt;
&lt;Grid&gt;
    &lt;dxc:ChartControl&gt;
        &lt;dxc:XYDiagram2D&gt;
            &lt;dxc:PointSeries2D DataSource=&quot;{Binding Data}&quot;
                               ArgumentDataMember=&quot;Argument&quot;&gt;
                &lt;!-- Configure the summary function options. --&gt;
                &lt;dxc:PointSeries2D.Summary&gt;
                    &lt;dxc:Summary&gt;
                        &lt;dxc:Summary.Function&gt;
                            &lt;dxc:AverageSummaryFunction ValueDataMember=&quot;Value&quot;/&gt;
                        &lt;/dxc:Summary.Function&gt;
                        &lt;dxc:Summary.NumericSummaryOptions&gt;
                            &lt;dxc:NumericSummaryOptions MeasureUnit=&quot;5&quot;/&gt;
                        &lt;/dxc:Summary.NumericSummaryOptions&gt;
                    &lt;/dxc:Summary&gt;
                &lt;/dxc:PointSeries2D.Summary&gt;
                &lt;!--...--&gt;
            &lt;/dxc:PointSeries2D&gt;
    &lt;/dxc:ChartControl&gt;
&lt;/Grid&gt;
</code></pre></section>
<section id="tabpanel_l2uC1mkQLJ-2_tabid-csharp-1" role="tabpanel" data-tab="tabid-csharp-1" aria-hidden="true" hidden="hidden">
<pre><code class="lang-csharp">public class ChartViewModel {
    public IEnumerable&lt;DataPoint&gt; Data { get; private set; }
    public ChartViewModel() {
        Data = new Collection&lt;DataPoint&gt; {
            new DataPoint { Argument= 1, Value = 853D},
            new DataPoint { Argument= 1, Value = 321D},
            new DataPoint { Argument= 2, Value = 655D},
            new DataPoint { Argument= 2, Value = 1325D},
            new DataPoint { Argument= 2, Value = 255D},
            new DataPoint { Argument= 2, Value = 981D},
            new DataPoint { Argument= 3, Value = 963D},
            new DataPoint { Argument= 3, Value = 123D},
            new DataPoint { Argument= 3, Value = 1011D},
            new DataPoint { Argument= 5, Value = 1356D},
            new DataPoint { Argument= 5, Value = 232D},
            new DataPoint { Argument= 5, Value = 1323D},
            new DataPoint { Argument= 5, Value = 1125D},
            new DataPoint { Argument= 6, Value = 865D},
            new DataPoint { Argument= 6, Value = 865D},
            new DataPoint { Argument= 10, Value = 1006D},
            new DataPoint { Argument= 10, Value = 236D},
            new DataPoint { Argument= 16, Value = 1090D},
            new DataPoint { Argument= 18, Value = 496D},
            new DataPoint { Argument= 18, Value = 691D},
            new DataPoint { Argument= 20, Value = 1125D},
            new DataPoint { Argument= 20, Value = 600D},
            new DataPoint { Argument= 20, Value = 770D}
        };
    }
}
public class DataPoint {
    public double Argument { get; set; }
    public double Value { get; set; }
}
</code></pre></section>
<section id="tabpanel_l2uC1mkQLJ-2_tabid-vb-1" role="tabpanel" data-tab="tabid-vb-1" aria-hidden="true" hidden="hidden">
<pre><code class="lang-vb">Public Class ChartViewModel
    Public Property Data As IEnumerable(Of DataPoint)
    Public Sub New()
        Data = New Collection(Of DataPoint) From {
            New DataPoint With {.Argument = 1, .Value = 853R},
            New DataPoint With {.Argument = 1, .Value = 321R},
            New DataPoint With {.Argument = 2, .Value = 655R},
            New DataPoint With {.Argument = 2, .Value = 1325R},
            New DataPoint With {.Argument = 2, .Value = 255R},
            New DataPoint With {.Argument = 2, .Value = 981R},
            New DataPoint With {.Argument = 3, .Value = 963R},
            New DataPoint With {.Argument = 3, .Value = 123R},
            New DataPoint With {.Argument = 3, .Value = 1011R},
            New DataPoint With {.Argument = 5, .Value = 1356R},
            New DataPoint With {.Argument = 5, .Value = 232R},
            New DataPoint With {.Argument = 5, .Value = 1323R},
            New DataPoint With {.Argument = 5, .Value = 1125R},
            New DataPoint With {.Argument = 6, .Value = 865R},
            New DataPoint With {.Argument = 6, .Value = 865R},
            New DataPoint With {.Argument = 10, .Value = 1006R},
            New DataPoint With {.Argument = 10, .Value = 236R},
            New DataPoint With {.Argument = 16, .Value = 1090R},
            New DataPoint With {.Argument = 18, .Value = 496R},
            New DataPoint With {.Argument = 18, .Value = 691R},
            New DataPoint With {.Argument = 20, .Value = 1125R},
            New DataPoint With {.Argument = 20, .Value = 600R},
            New DataPoint With {.Argument = 20, .Value = 770R}
        }
    End Sub
End Class
Public Class DataPoint
    Public Property Argument As Double
    Public Property Value As Double
End Class
</code></pre></section>