Back to Devexpress

DxPolarChart<T>.SelectionChanged Event

blazor-devexpress-dot-blazor-dot-dxpolarchart-1-507dd5dd.md

latest4.7 KB
Original Source

DxPolarChart<T>.SelectionChanged Event

Fires when point or series selection changes.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public EventCallback<PolarChartSelectionChangedEventArgs> SelectionChanged { get; set; }

Event Data

The SelectionChanged event's data class is PolarChartSelectionChangedEventArgs. The following properties provide information specific to this event:

PropertyDescription
IsPointSelectedReturns whether a point is selected.
IsSeriesSelectedReturns whether a series is selected.
PointReturns the last selected or deselected point.
SeriesReturns the clicked series or the series to which the clicked point belongs.

Remarks

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:

Example

The following snippet displays the coordinates of a selected point:

razor
<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;
    }
}
csharp
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;
        }
    }
}
csharp
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

DxPolarChart<T> Class

DxPolarChart<T> Members

DevExpress.Blazor Namespace