Back to Devexpress

SunburstControl.CalcHitInfo(Point) Method

wpf-devexpress-dot-xpf-dot-treemap-dot-sunburstcontrol-dot-calchitinfo-x28-system-dot-windows-dot-point-x29.md

latest2.5 KB
Original Source

SunburstControl.CalcHitInfo(Point) Method

Returns information about the specified element in the SunburstControl.

Namespace : DevExpress.Xpf.TreeMap

Assembly : DevExpress.Xpf.TreeMap.v25.2.dll

NuGet Package : DevExpress.Wpf.TreeMap

Declaration

csharp
public SunburstHitInfo CalcHitInfo(
    Point point
)
vb
Public Function CalcHitInfo(
    point As Point
) As SunburstHitInfo

Parameters

NameTypeDescription
pointPoint

Test point coordinates relative to the Sunburst chart’s top-left corner.

|

Returns

TypeDescription
SunburstHitInfo

Contains information about the Sunburst chart’s elements at the test point.

|

Remarks

The following code invokes a message box when a user double-clicks a Sunburst sector:

xaml
<dxtm:SunburstControl x:Name="sunburstControl"
                      MouseDoubleClick="SunburstControl_MouseDoubleClick">
                      <!--...-->
</dxtm:SunburstControl>
csharp
private void SunburstControl_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) {
    SunburstHitInfo hitInfo = sunburstControl.CalcHitInfo(e.GetPosition(sunburstControl));
    if (hitInfo != null) {
        MessageBox.Show($"Sector value: {hitInfo.ItemInfo.Value}");
    }
}
vb
Private Sub SunburstControl_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
    Dim hitInfo As SunburstHitInfo = sunburstControl.CalcHitInfo(e.GetPosition(sunburstControl))
    If hitInfo IsNot Nothing Then
        MessageBox.Show($"Sector value: {hitInfo.ItemInfo.Value}")
    End If
End Sub

See Also

SunburstControl Class

SunburstControl Members

DevExpress.Xpf.TreeMap Namespace