[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Charting Basics
   [Expand]Series Views
   [Collapse]Chart Elements
     [Expand]Diagram Types
       Axis Scale Types
       Whole and Visual Axis Ranges
       Primary and Secondary Axes
       Grid Lines, Tickmarks and Interlacing
       Axis Appearance and Position
       Axis Titles
       Axis Labels
       Constant Lines
       Scale Breaks
     Chart Titles
   [Expand]Providing Data
   [Expand]Data Representation
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Additional Resources
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Constant Lines

This document describes how to display a constant line across an axis, and customize the constant line. Before you proceed with this document, you may wish to review the basics of using Axes.

A Constant line is used to visually represent an axis value as a line perpendicular to the axis to which it belongs. It can be drawn over or behind the Diagram's Series.

To create a constant line and add it to an axis at design time, locate the axis in the Properties window, and click the ellipsis button for the Axis2D.ConstantLines property. The Constant Line Collection Editor will appear.

In this editor, click Add to create a constant line, and define its properties.

The most important property of a constant line is the ConstantLine.AxisValue property, which determines the value on the axis across which the constant line is drawn. This value should fall into the range defined for the current axis, in order for the constant line to be visible on a diagram.


The ConstantLine.AxisValue should be appropriate for the axis scale type.

The axis type and constant line axis value

The resulting image


ConstantLine.AxisValue = 350


ConstantLine.AxisValue = Indiana

To control whether a constant line should be drawn behind or above a chart's series, use the ConstantLine.ShowBehind property. Note that this property doesn't affect the position of a constant line's title.

The property value The resulting image
ConstantLine.ShowBehind = false
ConstantLine.ShowBehind = true

Then, it's possible to display a constant line's titles both in a diagram and in a legend.

Finally, it is possible to define the appearance options of a constant line, notably the ConstantLine.Color, LineStyle.DashStyle and LineStyle.Thickness properties.

Use the ConstantLine.Visible property to hide a constant line while maintaining it in an axis' collection.

Expanded See Also

Is this topic helpful?​​​​​​​