XRChart.RegisterSummaryFunction(String, String, ScaleType, Int32, SummaryFunctionArgumentDescription[], SummaryFunction) Method
Obsolete. Registers the custom summary function with the specified settings.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v20.2.dll
Declaration
[Obsolete("This method is obsolete now. Use the static RegisterGlobalSummaryFunction method instead.", false)]
public void RegisterSummaryFunction(
string name,
string displayName,
ScaleType resultScaleType,
int resultDimension,
SummaryFunctionArgumentDescription[] argumentDescriptions,
SummaryFunction function
)
<Obsolete("This method is obsolete now. Use the static RegisterGlobalSummaryFunction method instead.", False)>
Public Sub RegisterSummaryFunction(
name As String,
displayName As String,
resultScaleType As ScaleType,
resultDimension As Integer,
argumentDescriptions As SummaryFunctionArgumentDescription(),
function As SummaryFunction
)
Parameters
Name | Type | Description |
---|---|---|
name | String | A String value containing the function's name. |
displayName | String | A String value containing the function's display name, which is used for localization purposes. |
resultScaleType | ScaleType | A ScaleType enumeration value representing the type of the function's result. |
resultDimension | Int32 | An integer value representing the dimension of the resulting series point's values. |
argumentDescriptions | SummaryFunctionArgumentDescription[] | An array of SummaryFunctionArgumentDescription objects containing argument descriptions. |
function | SummaryFunction | A SummaryFunction delegate to be registered. |
Remarks
The RegisterSummaryFunction method is intended to register custom summary functions within a chart control. To unregister a specific summary function, the XRChart.UnregisterSummaryFunction method should be called. Also, you may remove all custom summary functions from the chart, and add all default functions to it by calling the XRChart.ResetSummaryFunctions method.
Example
The following example demonstrates how to create a custom summary function, which returns a product of two values (Price * Count). To accomplish this task, it is required to create a summary function delegate and register it via the ChartControl.RegisterSummaryFunction method.
The code below illustrates how this can be done.
NOTE
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-register-and-use-a-custom-summary-function-t257050.
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Threading.Tasks
Imports System.Windows.Forms
Namespace RegisterSummaryFunctionExample
Friend NotInheritable Class Program
Private Sub New()
End Sub
''' <summary>
''' The main entry point for the application.
''' </summary>
<STAThread> _
Shared Sub Main()
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
Application.Run(New Form1())
End Sub
End Class
End Namespace