Back to Devexpress

CrosshairAxisLabelOptions Class

wpf-devexpress-dot-xpf-dot-charts-47e38139.md

latest4.8 KB
Original Source

CrosshairAxisLabelOptions Class

Contains settings that define the appearance of crosshair axis labels.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public class CrosshairAxisLabelOptions :
    ChartDependencyObject
vb
Public Class CrosshairAxisLabelOptions
    Inherits ChartDependencyObject

The following members return CrosshairAxisLabelOptions objects:

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:

xaml
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" 
        x:Class="WpfApplication1.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxc:ChartControl>
            <dxc:XYDiagram2D>
                <dxc:XYDiagram2D.AxisX>
                    <dxc:AxisX2D>
                        <dxc:AxisX2D.CrosshairAxisLabelOptions>
                            <dxc:CrosshairAxisLabelOptions Background="Aqua" Foreground="Azure" 
                                                            FontSize="14" FontStyle="Italic">
                            </dxc:CrosshairAxisLabelOptions>
                        </dxc:AxisX2D.CrosshairAxisLabelOptions>
                    </dxc:AxisX2D>
                </dxc:XYDiagram2D.AxisX>
                <dxc:LineSeries2D>
                    <dxc:SeriesPoint Argument="A" Value="3"/>
                    <dxc:SeriesPoint Argument="B" Value="6"/>
                    <dxc:SeriesPoint Argument="C" Value="7"/>
                    <dxc:SeriesPoint Argument="D" Value="9"/>
                </dxc:LineSeries2D>
            </dxc:XYDiagram2D>
            <dxc:ChartControl.CrosshairOptions>
                <dxc:CrosshairOptions ShowArgumentLabels="True" ShowValueLabels="True" />
            </dxc:ChartControl.CrosshairOptions>
        </dxc:ChartControl>
    </Grid>
</Window>

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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CrosshairAxisLabelOptions class.

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.

wpf-charts-custom-draw-crosshair-cursor/CS/CrosshairCustomDraw/MainWindow.xaml#L20

xml
<dxc:AxisX2D.CrosshairAxisLabelOptions>
    <dxc:CrosshairAxisLabelOptions Pattern="{}{V:f1}"/>
</dxc:AxisX2D.CrosshairAxisLabelOptions>

Inheritance

Object DispatcherObject DependencyObject Freezable ChartDependencyObject CrosshairAxisLabelOptions

See Also

CrosshairAxisLabelOptions Members

DevExpress.Xpf.Charts Namespace