Class AccumulationChartEvents
Gets and sets the events for the accumulation chart.
Inherited Members
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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;
}
}
}