What Changed
The PointClick
event has been removed. Its functionality is moved to the DxChart.SeriesClick
(DxPieChart.SeriesClick
) event. You can now use the ChartSeriesClickEventArgs.Point
(PieChartSeriesClickEventArgs.Point
) property in the SeriesClick
event handler to track series point clicks. The Point
property returns null
if a user clicks a series (line or area), but not a point.
Reasons for Change
The simultaneous use of the PointClick
and SeriesClick
events may lead to unexpected behavior.
Impact on Existing Apps
This change causes the CS0246 compiler error (The type or namespace name 'ChartPointClickEventArgs' could not be found (are you missing a using directive or an assembly reference?) if you use ChartPointClickEventArgs
in the PointClick event handler's parameters.
How to Update Existing Apps
Follow the steps below to upgrade your application:
- Handle the
DxChart.SeriesClick
orDxPieChart.SeriesClick
event. - Use the
ChartSeriesClickEventArgs.Point
orPieChartSeriesClickEventArgs.Point
property to obtain the point that a user clicked.
The example below shows upgraded markup:
Razor<DxPieChart SeriesClick=@OnSeriesClick>
<@*...*@>
</DxPieChart>
@if(ClickedPointArgs != null) {
<div id="point-args">
<table>
<tr> <td>Point Value:</td><td> @ClickedPointArgs.Point.Value</td> </tr>
<tr> <td>Argument:</td><td> @ClickedPointArgs.Point.Argument</td> </tr>
</table>
</div>
}
@code {
PieChartSeriesClickEventArgs ClickedPointArgs { get; set; }
void OnSeriesClick(PieChartSeriesClickEventArgs seriesArgs) {
ClickedPointArgs = seriesArgs;
}
}