Back to Devexpress

ChartHitInfo.InSeries Property

corelibraries-devexpress-dot-xtracharts-dot-charthitinfo.md

latest3.9 KB
Original Source

ChartHitInfo.InSeries Property

Gets a value indicating whether the test point is within the series.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public bool InSeries { get; }
vb
Public ReadOnly Property InSeries As Boolean

Property Value

TypeDescription
Boolean

true if the test point is within a series; otherwise, false.

|

Remarks

The InSeries property is useful if you don’t need to determine the exact element residing under the test point and are only interested in whether the point is within a series. For instance, the property can be used if you need to provide a common context menu for a series regardless of which particular series element was right-clicked. If you need to obtain a particular element located under the test point, use the ChartHitInfo.HitTest property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the InSeries property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-charts-show-chart-legend-with-markers-in-separate-control/CS/Form1.cs#L75

csharp
{
    if (e.HitInfo.InSeries)
    {

winforms-chart-draw-a-custom-legend-marker-for-a-series/CS/CustomDrawingSample/Form1.cs#L58

csharp
private void OnObjectHotTracked(object sender, HotTrackEventArgs e) {
    trackedSeriesName = e.HitInfo.InSeries ? ((Series)e.HitInfo.Series).Name : null;
}

winforms-charts-show-chart-legend-with-markers-in-separate-control/VB/Form1.vb#L71

vb
Private Sub chart_ObjectSelected(ByVal sender As Object, ByVal e As HotTrackEventArgs)
    If e.HitInfo.InSeries Then
        gridView1.FocusedRowHandle = gridView1.GetRowHandle(chart.Series.IndexOf(CType(e.Object, Series)))

winforms-chart-draw-a-custom-legend-marker-for-a-series/VB/CustomDrawingSample/Form1.vb#L62

vb
Private Sub OnObjectHotTracked(ByVal sender As Object, ByVal e As HotTrackEventArgs)
    trackedSeriesName = If(e.HitInfo.InSeries, CType(e.HitInfo.Series, Series).Name, Nothing)
End Sub

See Also

HitTest

ChartHitInfo Class

ChartHitInfo Members

DevExpress.XtraCharts Namespace