Version

Chart Crosshair

This topic explains, with code examples, how to enable and customize the crosshair in the XamDataChart™ control.

Introduction

In the XamDataChart control, the crosshair is a set of two perpendicular (vertical and horizontal) lines used to locate with precision a particular point on the chart. The crosshair is helpful when identifying the relationship between some points on the graph that are aligned on or near the same axis values. The lines of the crosshair intersect at the position that corresponds to the horizontal (x-axis) or vertical (y-axis) location of the tap finger .

xamDataChart RT Chart Crosshair 01.png

Figure 1: The XamDataChart control with a custom style for crosshair lines

Enabling the Crosshair

The following code snippet demonstrates how to enable crosshairs in the XamDataChart control.

In XAML:

<ig:XamDataChart x:Name="Chart" CrosshairVisibility="Visible" />

In C#:

var chart = new XamDataChart();
chart.CrosshairVisibility = Visibility.Visible;