DxPolarChart<T>.DeselectSeries(Int32) Method
Deselects a series with the specified index.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public void DeselectSeries(
int seriesIndex
)
Parameters
Name | Type | Description |
---|---|---|
seriesIndex | Int32 | The series position in chart markup. |
Remarks
Set the DxPolarChart.SeriesSelectionMode property to Single
or Multiple
to enable series selection in <DxPolarChart>
.
Call SelectSeries method overloads to select a specific series in code. For line and area series, the Polar Chart component applies selection based on the corresponding SelectionMode
property value:
To deselect a series in code, call DeselectSeries
method overloads. You can also call the ClearSelectionAsync() method to reset selection in the entire Polar Chart component.
When you call SelectSeries or DeselectSeries
method overloads, <DxPolarChart>
raises the SelectionChanged event. You can obtain information about the selected series in the event handler.
Example
The following code snippet selects and deselects the specified chart series on button clicks:
<DxPolarChart Data="@DataSource"
Width="600px"
Height="400px"
@ref="polarChart"
SeriesSelectionMode="ChartSelectionMode.Single">
<DxPolarChartBarSeries ArgumentField="@((StatisticPoint v) => v.Country)"
ValueField="@((StatisticPoint v) => v.Population24)"
Name="2024" />
<DxPolarChartLineSeries ArgumentField="@((StatisticPoint v) => v.Country)"
ValueField="@((StatisticPoint v) => v.Population23)"
Name="2023" />
<DxChartTitle Text="Population by Country" />
<DxChartLegend Orientation="Orientation.Vertical"
HorizontalAlignment="HorizontalAlignment.Right"
Position="RelativePosition.Outside" />
</DxPolarChart>
<DxButton Text="Select a series"
Click="SelectSeries"
RenderStyleMode="ButtonRenderStyleMode.Outline" />
<DxButton Text="Deselect a series"
Click="DeselectSeries"
RenderStyleMode="ButtonRenderStyleMode.Outline" />
@code {
DxPolarChart<StatisticPoint> polarChart;
IEnumerable<StatisticPoint> DataSource = Enumerable.Empty<StatisticPoint>();
protected override void OnInitialized() {
DataSource = GenerateData();
}
void SelectSeries() {
// Pass the series index (order) as a parameter
polarChart.SelectSeries(1);
// Pass the series name as a parameter
polarChart.SelectSeries("2023");
}
void DeselectSeries() {
// Pass the series index (order) as a parameter
polarChart.DeselectSeries(1);
// Pass the series name as a parameter
polarChart.DeselectSeries("2023");
}
}