Back to Devexpress

SummaryDataAdapter.QualitativeSummaryOptions Property

corelibraries-devexpress-dot-xtracharts-dot-summarydataadapter-d24edc5c.md

latest12.9 KB
Original Source

SummaryDataAdapter.QualitativeSummaryOptions Property

Returns options that configure how the series calculates summary values of its data source with qualitative arguments.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[PersistenceMode(PersistenceMode.InnerProperty)]
[XtraChartsLocalizableCategory(XtraChartsCategory.Data)]
public QualitativeSummaryOptions QualitativeSummaryOptions { get; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Data)>
<PersistenceMode(PersistenceMode.InnerProperty)>
Public ReadOnly Property QualitativeSummaryOptions As QualitativeSummaryOptions

Property Value

TypeDescription
QualitativeSummaryOptions

Stores summarization settings for a chart with qualitative arguments.

|

Remarks

The QualitativeSummaryOptions include the SummaryFunction property, which defines a function used to summarize series values.

Example

The following example shows how to create a series and aggregate points with equal arguments.

A summary function is not applied.A summary function (SUM) is applied.
csharp
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;

namespace SummaryChart {
        private void OnLoad(object sender, EventArgs e) {
            // Create a series.
            Series series = new Series("Series", ViewType.Point);

            // Create a summary data adapter.
            SummaryDataAdapter dataAdapter = new SummaryDataAdapter();

            // Specify the data source.
            dataAdapter.DataSource = SaleInfo.GetSaleInfos();

            // Create a data member that defines arguments.
            dataAdapter.DataMembers.Add(new DataMember {
                DataMemberType = ChartDataMemberType.Argument,
                ColumnName = "Category",
                ScaleType = ScaleType.Qualitative
            });
            // Create a data member that defines values.
            dataAdapter.DataMembers.Add(new DataMember {
                DataMemberType = ChartDataMemberType.Value,
                ColumnName = "Value",
                ScaleType = ScaleType.Numerical
            });

            // Specify a summary function.
            dataAdapter.QualitativeSummaryOptions.SummaryFunction = "SUM([Value])";

            // Assign the data adapter to the series.
            series.DataAdapter = dataAdapter;

            // Add the series to the chart.
            chart.Series.Add(series);

        }

        public class SaleInfo {
            public string Category { get; set; }
            public string Region { get; set; }
            public double Value { get; set; }

            public static List<SaleInfo> GetSaleInfos() {
                return new List<SaleInfo> {
                    new SaleInfo { Category= "Video players", Region = "Asia", Value = 853D},
                    new SaleInfo { Category= "Video players", Region = "Australia", Value = 321D},
                    new SaleInfo { Category= "Video players", Region = "Europe", Value = 655D},
                    new SaleInfo { Category= "Video players", Region = "North America", Value = 1325D},
                    new SaleInfo { Category= "Video players", Region = "South America", Value = 653D},
                    new SaleInfo { Category= "Automation", Region = "Asia", Value = 172D},
                    new SaleInfo { Category= "Automation", Region = "Australia", Value = 255D},
                    new SaleInfo { Category= "Automation", Region = "Europe", Value = 981D},
                    new SaleInfo { Category= "Automation", Region = "North America", Value = 963D},
                    new SaleInfo { Category= "Automation", Region = "South America", Value = 123D},
                    new SaleInfo { Category= "Monitors", Region = "Asia", Value = 1011D},
                    new SaleInfo { Category= "Monitors", Region = "Australia", Value = 359D},
                    new SaleInfo { Category= "Monitors", Region = "Europe", Value = 721D},
                    new SaleInfo { Category= "Monitors", Region = "North America", Value = 565D},
                    new SaleInfo { Category= "Monitors", Region = "South America", Value = 532D},
                    new SaleInfo { Category= "Projectors", Region = "Asia", Value = 998D},
                    new SaleInfo { Category= "Projectors", Region = "Australia", Value = 222D},
                    new SaleInfo { Category= "Projectors", Region = "Europe", Value = 865D},
                    new SaleInfo { Category= "Projectors", Region = "North America", Value = 787D},
                    new SaleInfo { Category= "Projectors", Region = "South America", Value = 332D},
                    new SaleInfo { Category= "Televisions", Region = "Asia", Value = 1356D},
                    new SaleInfo { Category= "Televisions", Region = "Australia", Value = 232D},
                    new SaleInfo { Category= "Televisions", Region = "Europe", Value = 1323D},
                    new SaleInfo { Category= "Televisions", Region = "North America", Value = 1125D},
                    new SaleInfo { Category= "Televisions", Region = "South America", Value = 865D}
                };
            }
        }
    }
}
vb
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraCharts

Namespace SummaryChart
    Private Sub OnLoad(ByVal sender As Object, ByVal e As EventArgs)
        ' Create a series.
        Dim series As Series = New Series("Series", ViewType.Point)
        ' Create a summary data adapter.
        Dim dataAdapter As SummaryDataAdapter = New SummaryDataAdapter()
        ' Specify the data source.
        dataAdapter.DataSource = SaleInfo.GetSaleInfos()
        ' Create a data member that defines arguments.
        dataAdapter.DataMembers.Add(New DataMember With {
            .DataMemberType = ChartDataMemberType.Argument,
            .ColumnName = "Category",
            .ScaleType = ScaleType.Qualitative
        })
        ' Create a data member that defines values.
        dataAdapter.DataMembers.Add(New DataMember With {
            .DataMemberType = ChartDataMemberType.Value,
            .ColumnName = "Value",
            .ScaleType = ScaleType.Numerical
        })
        ' Specify a summary function.
        dataAdapter.QualitativeSummaryOptions.SummaryFunction = "SUM([Value])"
        ' Assign the data adapter to the series.
        series.DataAdapter = dataAdapter
        ' Add the series to the chart.
        chart.Series.Add(series)
    End Sub

    Public Class SaleInfo
        Public Property Category As String
        Public Property Region As String
        Public Property Value As Double

        Public Shared Function GetSaleInfos() As List(Of SaleInfo)
            Return New List(Of SaleInfo) From {
                New SaleInfo With {
                    .Category = "Video players",
                    .Region = "Asia",
                    .Value = 853R
                },
                New SaleInfo With {
                    .Category = "Video players",
                    .Region = "Australia",
                    .Value = 321R
                },
                New SaleInfo With {
                    .Category = "Video players",
                    .Region = "Europe",
                    .Value = 655R
                },
                New SaleInfo With {
                    .Category = "Video players",
                    .Region = "North America",
                    .Value = 1325R
                },
                New SaleInfo With {
                    .Category = "Video players",
                    .Region = "South America",
                    .Value = 653R
                },
                New SaleInfo With {
                    .Category = "Automation",
                    .Region = "Asia",
                    .Value = 172R
                },
                New SaleInfo With {
                    .Category = "Automation",
                    .Region = "Australia",
                    .Value = 255R
                },
                New SaleInfo With {
                    .Category = "Automation",
                    .Region = "Europe",
                    .Value = 981R
                },
                New SaleInfo With {
                    .Category = "Automation",
                    .Region = "North America",
                    .Value = 963R
                },
                New SaleInfo With {
                    .Category = "Automation",
                    .Region = "South America",
                    .Value = 123R
                },
                New SaleInfo With {
                    .Category = "Monitors",
                    .Region = "Asia",
                    .Value = 1011R
                },
                New SaleInfo With {
                    .Category = "Monitors",
                    .Region = "Australia",
                    .Value = 359R
                },
                New SaleInfo With {
                    .Category = "Monitors",
                    .Region = "Europe",
                    .Value = 721R
                },
                New SaleInfo With {
                    .Category = "Monitors",
                    .Region = "North America",
                    .Value = 565R
                },
                New SaleInfo With {
                    .Category = "Monitors",
                    .Region = "South America",
                    .Value = 532R
                },
                New SaleInfo With {
                    .Category = "Projectors",
                    .Region = "Asia",
                    .Value = 998R
                },
                New SaleInfo With {
                    .Category = "Projectors",
                    .Region = "Australia",
                    .Value = 222R
                },
                New SaleInfo With {
                    .Category = "Projectors",
                    .Region = "Europe",
                    .Value = 865R
                },
                New SaleInfo With {
                    .Category = "Projectors",
                    .Region = "North America",
                    .Value = 787R
                },
                New SaleInfo With {
                    .Category = "Projectors",
                    .Region = "South America",
                    .Value = 332R
                },
                New SaleInfo With {
                    .Category = "Televisions",
                    .Region = "Asia",
                    .Value = 1356R
                },
                New SaleInfo With {
                    .Category = "Televisions",
                    .Region = "Australia",
                    .Value = 232R
                },
                New SaleInfo With {
                    .Category = "Televisions",
                    .Region = "Europe",
                    .Value = 1323R
                },
                New SaleInfo With {
                    .Category = "Televisions",
                    .Region = "North America",
                    .Value = 1125R
                },
                New SaleInfo With {
                    .Category = "Televisions",
                    .Region = "South America",
                    .Value = 865R
                }
            }
        End Function
    End Class
End Namespace

See Also

SummaryDataAdapter Class

SummaryDataAdapter Members

DevExpress.XtraCharts Namespace