blazor-devexpress-dot-blazor-dot-dxpolarchart-1-507dd5dd.md
Fires when point or series selection changes.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[Parameter]
public EventCallback<PolarChartSelectionChangedEventArgs> SelectionChanged { get; set; }
The SelectionChanged event's data class is PolarChartSelectionChangedEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| IsPointSelected | Returns whether a point is selected. |
| IsSeriesSelected | Returns whether a series is selected. |
| Point | Returns the last selected or deselected point. |
| Series | Returns the clicked series or the series to which the clicked point belongs. |
Use the SeriesSelectionMode or PointSelectionMode property to enable series or point selection in the <DxPolarChart> component.
The SelectionChanged event fires when a user selects/deselects a series/point or you call the following methods:
The following snippet displays the coordinates of a selected point:
<DxPolarChart Data=@DataSource
PointSelectionMode="ChartSelectionMode.Multiple"
SelectionChanged="OnSelectionChanged">
<DxPolarChartArgumentAxis Inverted="true" StartAngle="90" TickInterval="30"/>
<DxPolarChartLineSeries ArgumentField="@((DataPoint i) => i.X)"
ValueField="@((DataPoint i) => i.Y)">
</DxPolarChartLineSeries>
</DxPolarChart>
<p>The (@Argument; @Value) point was selected.</p>
@code {
IEnumerable<DataPoint> DataSource = Enumerable.Empty<DataPoint>();
object Argument, Value;
protected override void OnInitialized () {
DataSource = ChartContinuousDataProvider.GenerateData();
}
void OnSelectionChanged(PolarChartSelectionChangedEventArgs args) {
Argument = args.Point.Argument;
Value = args.Point.Value;
}
}
using System;
using System.Runtime.InteropServices;
namespace BlazorDemo.Data {
// ...
public class DataPoint {
public double X { get; }
public double Y { get; }
public DataPoint(double x, double y) {
X = x;
Y = y;
}
}
}
using System.Collections.Generic;
using BlazorDemo.Data;
// ...
public class ChartContinuousDataProvider : IChartContinuousDataProvider {
public List<DataPoint> GenerateData() {
return new List<DataPoint>() {
new DataPoint(0, 0),
new DataPoint(30, 1.7),
new DataPoint(45, 0),
new DataPoint(60, 1.7),
new DataPoint(90, 0),
new DataPoint(120, 1.7),
new DataPoint(135, 0),
new DataPoint(150, 1.7),
new DataPoint(180, 0),
new DataPoint(210, 1.7),
new DataPoint(225, 0),
new DataPoint(240, 1.7),
new DataPoint(270, 0),
new DataPoint(300, 1.7),
new DataPoint(315, 0),
new DataPoint(330, 1.7),
new DataPoint(360, 0),
};
}
}
See Also