menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class AccumulationChartEvents - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class AccumulationChartEvents

    Gets and sets the events for the accumulation chart.

    Inheritance
    System.Object
    SfBaseComponent
    AccumulationChartEvents
    Inherited Members
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnAfterRenderAsync(Boolean)
    SfBaseComponent.OnInitializedAsync()
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class AccumulationChartEvents : SfBaseComponent

    Constructors

    AccumulationChartEvents()

    Declaration
    public AccumulationChartEvents()

    Properties

    Exporting

    Occurs when the chart export process is initiated.

    Declaration
    public Action<ChartExportEventArgs> Exporting { get; set; }
    Property Value
    Type Description
    System.Action<ChartExportEventArgs>

    An instance of the ChartExportEventArgs class, providing options for customizing the export operation.

    The properties available in ChartExportEventArgs include:

    • Cancel: A System.Boolean indicating whether the export operation should be canceled.
    • Name: A System.String representing the name of the event.
    • Width: A System.Double value specifying the width of the chart during export.
    • Height: A System.Double value specifying the height of the chart during export.
    • Workbook: A Syncfusion.ExcelExport.Workbook, applicable for XLSX and CSV export types.
    Remarks

    The ChartExportEventArgs class provides options for customizing the exported file.

    Examples
    // The following code snippet demonstrates how to implement the Exporting event in a chart:
    @using Syncfusion.Blazor.Charts
    <button @onclick="Export" class="btn-success">Export</button>
    <SfAccumulationChart Title="Mobile Browser Statistics" @ref="AccChart">
        <AccumulationChartEvents Exporting="OnExporting"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    @code {
        SfAccumulationChart AccChart;
        ...
        public void Export() {
            AccChart.ExportAsync(ExportType.JPEG, "Charts");
        }
        public void OnExporting(ChartExportEventArgs args) {
            args.Width = 1024;
            args.Height = 768;
        }
    }

    Loaded

    Triggers when the rendering process of the SfAccumulationChart is completed.

    Declaration
    public Action<AccumulationLoadedEventArgs> Loaded { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationLoadedEventArgs>

    Accepts a delegate of type System.Action with AccumulationLoadedEventArgs as the parameter, allowing actions to be performed after the chart rendering is completed.

    The properties available in AccumulationLoadedEventArgs include:

    • Cancel: A System.Boolean value from Syncfusion.Blazor.Charts.AccumulationRenderingEventArgs indicating whether the event should be canceled.
    • Name: A System.String from Syncfusion.Blazor.Charts.AccumulationRenderingEventArgs representing the name of the event.
    Remarks

    Use the AccumulationLoadedEventArgs to execute logic after the chart has been fully rendered, such as initializing additional elements or displaying completion messages.

    Examples
    // The following example shows how to execute logic after the accumulation chart rendering is completed using the Loaded event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents Loaded="ChartLoadedEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    
    @code {
        public void ChartLoadedEvent(AccumulationLoadedEventArgs args) {
            Console.WriteLine("Chart rendering completed.");
        }
    }

    OnDataLabelRender

    An event that is triggered before each data label is rendered for the series on the SfAccumulationChart.

    Declaration
    public Action<AccumulationTextRenderEventArgs> OnDataLabelRender { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationTextRenderEventArgs>

    Accepts a delegate of type System.Action with AccumulationTextRenderEventArgs as the parameter, enabling customization of data label rendering.

    The properties available in AccumulationTextRenderEventArgs include:

    • Series: The AccumulationChartSeries represents the collection of data in the Accumulation chart
    • Point: The AccumulationPoints representing the point for which the data label is being rendered.
    • Text: A System.String value that defines the text for the data label, which can be customized.
    • Color: A System.String value that defines the color of the data label text. The default value is transparent.
    • Border: A ChartCommonBorder object representing the border for the data label.
    • Font: A ChartCommonFont object representing the font for the data label.
    • Cancel: A System.Boolean value indicating whether the event should be canceled.
    • Name: A System.String that represents the name of the event.
    Remarks

    Utilize the AccumulationTextRenderEventArgs to modify the properties of data labels before they are rendered.

    Examples
    // The following example shows how to customize data labels in an accumulation chart using the OnDataLabelRender event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents OnDataLabelRender="DataLabelRenderEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
                <AccumulationDataLabelSettings Visible="true"></AccumulationDataLabelSettings>
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    
    @code {
        public void DataLabelRenderEvent(AccumulationTextRenderEventArgs args) {
            if (args.Text == "Chrome") {
                args.Text = "Google Chrome";
            }
        }
    }

    OnExportComplete

    A callback that will be invoked when the export operation of the SfAccumulationChart is completed.

    Declaration
    public Action<ExportEventArgs> OnExportComplete { get; set; }
    Property Value
    Type Description
    System.Action<ExportEventArgs>

    Accepts a delegate of type System.Action with ExportEventArgs as the parameter, enabling post-export operations or customization.

    The properties available in ExportEventArgs include:

    • DataUrl: A string that provides the URL for the exported chart image.
    • Base64: A Base64 string representation of the chart image. Applicable if isBase64 is enabled in the export method.
    • Cancel: From Syncfusion.Blazor.Charts.BaseEventArgs, indicates whether the event should be canceled.
    • Name: From Syncfusion.Blazor.Charts.BaseEventArgs, a string representing the name of the event.
    Remarks

    Utilize the ExportEventArgs to customize the export process or trigger additional operations after the export is complete.

    Examples
    // The following code snippet demonstrates how to handle the OnExportComplete event in an accumulation chart:
    @using Syncfusion.Blazor.Charts
    <button @onclick="Export" class="btn-success">Export</button>
    <SfAccumulationChart Title="Mobile Browser Statistics" @ref="AccChart">
        <AccumulationChartEvents OnExportComplete="ExportCompleteEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    @code {
        SfAccumulationChart AccChart;
        ...
        public void Export() {
            AccChart.ExportAsync(ExportType.JPEG, "Charts");
        }
        public void ExportCompleteEvent(ExportEventArgs args) {
            Console.WriteLine("Export completed.);
        }
    }

    OnLegendClick

    Triggers when a legend item in the SfAccumulationChart is clicked.

    Declaration
    public Action<AccumulationLegendClickEventArgs> OnLegendClick { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationLegendClickEventArgs>

    Accepts a delegate of type System.Action with AccumulationLegendClickEventArgs as the parameter, enabling interaction when a legend item is clicked.

    The properties available in AccumulationLegendClickEventArgs include:

    • Chart: The instance of the SfAccumulationChart associated with the event.
    • LegendShape: The LegendShape object representing the clicked legend's shape.
    • Point: The AccumulationPoints object representing the current data point associated with the legend item.
    • LegendText: A System.String value representing the text of the clicked legend item.
    • Name: A System.String representing the name of the event.
    • Cancel: A System.Boolean value indicating whether the event should be canceled.
    Remarks

    Use the AccumulationLegendClickEventArgs to respond to user interactions with legend items, such as updating the chart or performing other UI logic on a legend item click.

    Examples
    // The following example shows how to respond to legend item clicks in an accumulation chart using the OnLegendClick event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents OnLegendClick="LegendClickEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    
    @code {
        public void LegendClickEvent(AccumulationLegendClickEventArgs args) {
            if (args.LegendText == "Safari") {
                args.Cancel = true;
            }
        }
    }

    OnLegendItemRender

    Triggers before each legend item is rendered on the SfAccumulationChart.

    Declaration
    public Action<AccumulationLegendRenderEventArgs> OnLegendItemRender { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationLegendRenderEventArgs>

    Accepts a delegate of type System.Action with AccumulationLegendRenderEventArgs as the parameter, allowing customization of legend item rendering.

    The properties available in AccumulationLegendRenderEventArgs include:

    • Fill: A System.String value that defines the fill color for the legend.
    • Text: A System.String value that defines the legend text.
    • Shape: The LegendShape object representing the legend shape.
    • Cancel: A System.Boolean value indicating whether the event should be canceled.
    • Name: A System.String that represents the name of the event.
    Remarks

    Utilize the AccumulationLegendRenderEventArgs to modify the properties of legend items before they are rendered.

    Examples
    // The following example shows how to customize legend items in an accumulation chart using the OnLegendItemRender event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents OnLegendItemRender="LegendItemRenderEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    
    @code {
        public void LegendItemRenderEvent(AccumulationLegendRenderEventArgs args) {
            if (args.Text == "Chrome") {
                args.Fill = "blue";
            }
        }
    }

    OnPointClick

    Triggers when a point in the SfAccumulationChart is clicked.

    Declaration
    public Action<AccumulationPointEventArgs> OnPointClick { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationPointEventArgs>

    Accepts a delegate of type System.Action with AccumulationPointEventArgs as the parameter, enabling interaction when a point is clicked.

    The properties available in AccumulationPointEventArgs include:

    • PageX: A System.Double value representing the X coordinate on the page where the click occurred.
    • PageY: A System.Double value representing the Y coordinate on the page where the click occurred.
    • X: A System.Double value representing the X coordinate of the point in the chart's coordinate system.
    • Y: A System.Double value representing the Y coordinate of the point in the chart's coordinate system.
    • PointIndex: An System.Int32 representing the index of the clicked point.
    • SeriesIndex: An System.Int32 representing the index of the series to which the clicked point belongs.
    • Point: The AccumulationPoints object representing the clicked point.
    • IsRightClick: A System.Boolean indicating if the point was clicked using a right click.
    • Name: A System.String representing the name of the event.
    • Cancel: A System.Boolean value indicating whether the event should be canceled.
    Remarks

    Use the AccumulationPointEventArgs to handle user interactions with points on the chart, such as displaying additional information or triggering other logic when a point is clicked.

    Examples
    // The following example shows how to respond to point clicks in an accumulation chart using the OnPointClick event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents OnPointClick="PointClickEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    @code {
        public void PointClickEvent(AccumulationPointEventArgs args) {
            if (args.IsRightClick) {
                Console.WriteLine("Right-click detected on point.");
            }
        }
    }

    OnPointRender

    An event that is triggered before each point is rendered on the SfAccumulationChart.

    Declaration
    public Action<AccumulationPointRenderEventArgs> OnPointRender { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationPointRenderEventArgs>

    Accepts a delegate of type System.Action with AccumulationPointRenderEventArgs as the parameter, allowing customization of point rendering.

    The properties available in AccumulationPointRenderEventArgs include:

    • Series: The AccumulationChartSeries represents the collection of data in the Accumulation chart.
    • Point: The AccumulationPoints representing the point being rendered.
    • Fill: A System.String value that defines the fill color for the point. Default is an empty string.
    • Border: A ChartCommonBorder object representing the border for the point.
    • Cancel: A System.Boolean value indicating whether the event should be canceled.
    • Name: A System.String that represents the name of the event.
    Remarks

    Utilize the AccumulationPointRenderEventArgs to modify the properties of points before they are rendered.

    Examples
    // The following example shows how to customize point rendering in an accumulation chart using the OnPointRender event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents OnPointRender="PointRenderEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
                <AccumulationDataLabelSettings Visible="true"></AccumulationDataLabelSettings>
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    @code {
        public void PointRenderEvent(AccumulationPointRenderEventArgs args) {
            if (args.Point.Index == 0) {
                args.Fill = "red";
            }
        }
    }

    OnPrintComplete

    Triggers after the print operation of the SfAccumulationChart is completed.

    Declaration
    public Action OnPrintComplete { get; set; }
    Property Value
    Type Description
    System.Action

    Accepts a delegate of type System.Action, providing a mechanism to execute logic after the printing of the chart concludes.

    Remarks

    You can get notified when the print operation is completed through the OnPrintComplete event.

    Examples
    // The following code snippet demonstrates how to handle the OnPrintComplete event in an accumulation chart:
    <button @onclick="Print" class="btn-success">Print</button>
    <SfAccumulationChart Title="Mobile Browser Statistics" @ref="AccChart">
        <AccumulationChartEvents OnPrintComplete="PrintCompleteEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    @code {
        SfAccumulationChart AccChart;
        ...
        public void Print() {
            AccChart.PrintAsync();
        }
        public void PrintCompleteEvent() {
            Console.WriteLine("Print completed.");
        }
    }

    OnSelectionChanged

    Triggers after the selection process on the SfAccumulationChart is completed.

    Declaration
    public Action<AccumulationSelectionCompleteEventArgs> OnSelectionChanged { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationSelectionCompleteEventArgs>

    Accepts a delegate of type System.Action with AccumulationSelectionCompleteEventArgs as the parameter, enabling actions to be taken after selection changes.

    The properties available in AccumulationSelectionCompleteEventArgs include:

    • SelectedDataValues: A list of AccumulationPoint objects representing the currently selected data points.
    • Cancel: A System.Boolean value from Syncfusion.Blazor.Charts.BaseEventArgs indicating whether the event should be canceled.
    • Name: A System.String from Syncfusion.Blazor.Charts.BaseEventArgs representing the name of the event.
    Remarks

    Use the AccumulationSelectionCompleteEventArgs to respond to changes in selection, such as updating related data displays or triggering other UI updates after a selection is made in the chart.

    Examples
    // The following example shows how to respond to selection changes in an accumulation chart using the OnSelectionChanged event:
    <SfAccumulationChart Title="Mobile Browser Statistics" SelectionMode="AccumulationSelectionMode.Point">
        <AccumulationChartEvents OnSelectionChanged="SelectionChangedEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    
    @code {
        public void SelectionChangedEvent(AccumulationSelectionCompleteEventArgs args) {
            foreach (AccumulationPoint point in args.SelectedDataValues) {
                Console.WriteLine($"Selected Point - X: {point.X}, Y: {point.Y}");
            }
        }
    }

    SizeChanged

    Triggers after the resizing of the SfAccumulationChart is completed.

    Declaration
    public Action<AccumulationResizeEventArgs> SizeChanged { get; set; }
    Property Value
    Type Description
    System.Action<AccumulationResizeEventArgs>

    Accepts a delegate of type System.Action with AccumulationResizeEventArgs as the parameter, allowing actions to be taken following changes to the chart's size.

    The properties available in AccumulationResizeEventArgs include:

    • CurrentSize: A Size object representing the current size of the chart.
    • PreviousSize: A Size object representing the previous size of the chart before resizing.
    • Cancel: A System.Boolean from Syncfusion.Blazor.Charts.AccumulationRenderingEventArgs indicating whether the event should be canceled.
    • Name: A System.String from Syncfusion.Blazor.Charts.AccumulationRenderingEventArgs representing the name of the event.
    Remarks

    Utilize the AccumulationResizeEventArgs to perform updates or re-layout elements as needed when the chart's dimensions change.

    Examples
    // The following example shows how to respond to size changes in an accumulation chart using the SizeChanged event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents SizeChanged="ChartSizeChangedEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
    </SfAccumulationChart>
    
    @code {
        public void ChartSizeChangedEvent(AccumulationResizeEventArgs args) {
            Console.WriteLine($"Chart resized from {args.PreviousSize.Width} to {args.CurrentSize.Width}");
        }
    }

    TooltipRender

    Triggers before the tooltip for a series in the SfAccumulationChart is rendered.

    Declaration
    public Action<TooltipRenderEventArgs> TooltipRender { get; set; }
    Property Value
    Type Description
    System.Action<TooltipRenderEventArgs>

    Accepts a delegate of type System.Action with TooltipRenderEventArgs as the parameter, allowing customization of tooltip content and style before display.

    The properties available in TooltipRenderEventArgs include:

    • Data: A PointInfo object representing the point information for the tooltip.
    • HeaderText: A System.String representing the header text for the tooltip.
    • Point: An object representing the current tooltip point.
    • Series: An object representing the current tooltip series.
    • Text: A System.String representing the tooltip text collections.
    • TextStyle: A ChartDefaultFont object describing the text style of the tooltip.
    • Cancel: A System.Boolean from Syncfusion.Blazor.Charts.BaseEventArgs indicating whether the event should be canceled.
    • Name: A System.String from Syncfusion.Blazor.Charts.BaseEventArgs representing the name of the event.
    Remarks

    Use the TooltipRenderEventArgs to modify the appearance and content of the tooltip, such as altering text content, header information, or styling prior to rendering.

    Examples
    // The following example demonstrates how to customize tooltips in an accumulation chart using the TooltipRender event:
    <SfAccumulationChart Title="Mobile Browser Statistics">
        <AccumulationChartEvents TooltipRender="TooltipRenderEvent"></AccumulationChartEvents>
        <AccumulationChartSeriesCollection>
            <AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
            </AccumulationChartSeries>
        </AccumulationChartSeriesCollection>
        <AccumulationChartTooltipSettings Enable="true"></AccumulationChartTooltipSettings>
    </SfAccumulationChart>
    
    @code {
        public void TooltipRenderEvent(TooltipRenderEventArgs args) {
            if (args.Data != null && args.Data.PointIndex == 0) {
                args.Text = "Safari Users: " + args.Data.PointY;
            }
        }
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved