Skip to main content

CrosshairAxisLabelOptions Class

Contains settings that define the appearance of crosshair axis labels.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v14.2.dll

#Declaration

public class CrosshairAxisLabelOptions :
    ChartDependencyObject

#Returned By

The Axis2D.CrosshairAxisLabelOptions property returns an instance of CrosshairAxisLabelOptions.

#Remarks

Use the Axis2D.CrosshairAxisLabelOptions property to get access to the CrosshairAxisLabelOptions object.

The following XAML demonstrates how this can be done for the X-axis:


<UserControl x:Class="SilverlightApplication1_Silverlight.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" >

    <Grid>
        <dxga:ChartControl>
            <dxga:XYDiagram2D>
                <dxga:XYDiagram2D.AxisX>
                    <dxga:AxisX2D>
                        <dxga:AxisX2D.CrosshairAxisLabelOptions>
                            <dxga:CrosshairAxisLabelOptions  Background="Aqua"  Foreground="Azure" 
                                                            FontSize="14" FontStyle="Italic">
                            </dxga:CrosshairAxisLabelOptions>
                        </dxga:AxisX2D.CrosshairAxisLabelOptions>
                    </dxga:AxisX2D>
                </dxga:XYDiagram2D.AxisX>
                <dxga:LineSeries2D>
                    <dxga:SeriesPoint Argument="A" Value="3"/>
                    <dxga:SeriesPoint Argument="B" Value="6"/>
                    <dxga:SeriesPoint Argument="C" Value="7"/>
                    <dxga:SeriesPoint Argument="D" Value="9"/>
                </dxga:LineSeries2D>
            </dxga:XYDiagram2D>
            <dxga:ChartControl.CrosshairOptions>
                <dxga:CrosshairOptions ShowArgumentLabels="True" ShowValueLabels="True" />
            </dxga:ChartControl.CrosshairOptions>
        </dxga:ChartControl>
    </Grid>
</UserControl>
NOTE

To see the appearance changes of crosshair axis labels on a diagram, set the CrosshairOptions.ShowArgumentLabels and CrosshairOptions.ShowValueLabels properties to true.

For more information on how to use a crosshair cursor, refer to the Crosshair Cursor topic.

See Also