Back to Devexpress

PieSeriesView.RuntimeExploding Property

corelibraries-devexpress-dot-xtracharts-dot-pieseriesview-318dedfa.md

latest3.8 KB
Original Source

PieSeriesView.RuntimeExploding Property

Specifies whether a user can explode pie slices with the mouse pointer at runtime.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool RuntimeExploding { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property RuntimeExploding As Boolean

Property Value

TypeDescription
Boolean

true , if a user can drag pie slices; otherwise, false.

|

Remarks

The RuntimeExploding property is in effect when the ChartControl.RuntimeHitTesting property is set to true.

The animation below shows how a user can move out a pie slice at runtime:

Use the the PieSeriesViewBase.ExplodedDistancePercentage property to increase/decrease the distance between an exploded slice and the rest of the pie.

csharp
private void OnLoad(object sender, EventArgs e) {
    chartControl1.RuntimeHitTesting = true;
    PieSeriesView view = chartControl1.Series[0].View as PieSeriesView;
    view.RuntimeExploding = true;
    view.ExplodedDistancePercentage = 20;
}
vb
Private Sub OnLoad(ByVal sender As Object, ByVal e As EventArgs)
    chartControl1.RuntimeHitTesting = True
    Dim view As PieSeriesView = TryCast(chartControl1.Series(0).View, PieSeriesView)
    view.RuntimeExploding = True
    view.ExplodedDistancePercentage = 20
End Sub

For the WebChartControl, enable RuntimeExploding and add points that a user clicks to the PieSeriesViewBase.ExplodedPoints collection in the WebChartControl.ObjectSelected event handler.

Note

View Demo Online: Pie Series View

csharp
protected void WebChartControl1_ObjectSelected(object sender, HotTrackEventArgs e) {
    Series series = e.Object as Series;
    if (series != null) {
        ExplodedSeriesPointCollection explodedPoints = ((PieSeriesViewBase)series.View).ExplodedPoints;
        SeriesPoint point = (SeriesPoint)e.AdditionalObject;
        explodedPoints.ToggleExplodedState(point);
    }
    e.Cancel = series == null;
}
vb
Protected Sub WebChartControl1_ObjectSelected(ByVal sender As Object, ByVal e As HotTrackEventArgs)
    Dim series As Series = TryCast(e.Object, Series)
    If series IsNot Nothing Then
        Dim explodedPoints As ExplodedSeriesPointCollection = (CType(series.View, PieSeriesViewBase)).ExplodedPoints
        Dim point As SeriesPoint = CType(e.AdditionalObject, SeriesPoint)
        explodedPoints.ToggleExplodedState(point)
    End If
    e.Cancel = series Is Nothing
End Sub

See Also

PieSeriesView Class

PieSeriesView Members

DevExpress.XtraCharts Namespace