Skip to main content

Axis2D.VisualRange Property

Gets or sets the settings that specify the visible range of the axis coordinates.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public Range VisualRange { get; set; }

Property Value

Type Description
Range

A Range object which contains the common visual range settings of the axis coordinates.

Remarks

The VisualRange property is used in descendants of the AxisBase class. The primary settings exposed via the properties of the Range class allow you to specify, for example, the minimum and maximum axis values (see the Range.MinValue and Range.MaxValue properties).

Examples

The following markup shows how to specify visual and whole ranges:

<!--...-->
<dxc:XYDiagram2D.AxisX>
    <dxc:AxisX2D>
        <dxc:AxisX2D.WholeRange>
            <dxc:Range MinValue="05/24/2016" 
                       MaxValue="08/25/2016"/>
        </dxc:AxisX2D.WholeRange>
        <dxc:AxisX2D.VisualRange>
            <dxc:Range MinValue="06/18/2016" 
                       MaxValue="07/03/2016"/>
        </dxc:AxisX2D.VisualRange>
    </dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>
<!--...-->

The markup above uses the following classes and properties:

Class or Property Description
Axis.WholeRange Gets or sets the axis whole range’s settings.
Axis2D.VisualRange Gets or sets the axis visual range’s settings.
Range The axis range.
Range.MinValue The range’s minimum limit.
Range.MaxValue The range’s maximum limit.

You can call the Range.SetMinMaxValues method to limit a range at runtime. The following code customizes an x-axis’s visual range:

using DevExpress.Xpf.Charts;

private void Window_Loaded(object sender, RoutedEventArgs e) {
    Range visualRange = ((XYDiagram2D)chartControl1.Diagram).ActualAxisX.ActualVisualRange;
    visualRange.SetMinMaxValues(minValue: new DateTime(2019, 4, 1), maxValue: new DateTime(2019, 10, 1));
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the VisualRange 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.

See Also