[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Collapse]Chart Control
   [Expand]Product Information
   [Expand]Getting Started
    [Expand]Creating Charts
    [Collapse]Chart Elements
       Axes Overview
       Axis Scale Types
       Visual Ranges and Whole Ranges
       Primary and Secondary Axes
       Grid Lines,Tickmarks and Interlacing
       Axis Appearance and Position
       Axis Titles
       Axis Labels
       Constant Lines
       Scale Breaks
     [Expand]Chart Titles
    [Expand]End-User Interaction
     Supported Browsers
     Adding a Web Chart
     Handling Client-side Scripts
     Medium Trust Support
     Web Farm and Web Gardens Support
   [Expand]Design-Time Features
   [Expand]Visual Elements
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Constant Lines

This document describes how to display a constant line, and customize its appearance and position across an axis. 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 key 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.

Note that this value also should be appropriate for the axis scale type, as the following images demonstrate.

AxisValue = 10

AxisValue = "D"

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 does not affect the position of a constant line's title.

ShowBehind = False

ShowBehind = True

Then, it is 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?​​​​​​​