Back to Devexpress

SummaryOptionsBase.SummaryFunction Property

corelibraries-devexpress-dot-xtracharts-dot-summaryoptionsbase.md

latest4.1 KB
Original Source

SummaryOptionsBase.SummaryFunction Property

Gets or sets the summary function that calculates the series points’ total value.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Data)]
public string SummaryFunction { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Data)>
Public Property SummaryFunction As String

Property Value

TypeDescription
String

The string that defines the summary function that calculates the series points’ total value.

|

Remarks

The chart control provides the following built-in summary functions:

  • minimum (“MIN([Field_name])”);
  • maximum (“MAX([Field_name])”);
  • sum (“SUM([Field_name])”);
  • average (“AVERAGE([Field_name])”);
  • count (“COUNT()”).

Example

This example demonstrates how to use the summary options to configure the date-time data source summarization:

csharp
List<SaleItem> dataSource = this.viewModel.GetSaleItems();
this.chartControl.DataSource = dataSource;
SeriesTemplate template = this.chartControl.SeriesTemplate;
template.SeriesDataMember = "Category";
template.ArgumentDataMember = "Company";
template.DateTimeSummaryOptions.MeasureUnit = DateTimeMeasureUnit.Month;
template.DateTimeSummaryOptions.SummaryFunction = "SUM([Income])";
template.View = new StackedBarSeriesView();
vb
Dim dataSource As List<SaleItem> = Me.ViewModel.GetSaleItems()
Me.ChartControl.DataSource = dataSource
With Me.chartControl.SeriesTemplate
    .SeriesDataMember = "Category"
    .ArgumentDataMember = "Company"
    .DateTimeSummaryOptions.MeasureUnit = DateTimeMeasureUnit.Month
    .DateTimeSummaryOptions.SummaryFunction = "SUM([Income])"
    .View = new StackedBarSeriesView()
End With

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SummaryFunction 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.

winforms-charts-apply-the-best-fit-function-to-a-series/CS/LineOfBestFit/Form1.cs#L108

csharp
chartControl1.Series[1].ValueDataMembers.AddRange(new string[] { "MyData" });
this.chartControl1.Series[1].NumericSummaryOptions.SummaryFunction = "BESTFIT()";
this.textBox1.Text = r.ToString();

winforms-charts-apply-the-best-fit-function-to-a-series/VB/LineOfBestFit/Form1.vb#L93

vb
chartControl1.Series(1).ValueDataMembers.AddRange(New String() {"MyData"})
chartControl1.Series(1).NumericSummaryOptions.SummaryFunction = "BESTFIT()"
textBox1.Text = r.ToString()

See Also

Calculate Summaries

SummaryOptionsBase Class

SummaryOptionsBase Members

DevExpress.XtraCharts Namespace