Back to Devexpress

AxisXBase.StickToEdge Property

corelibraries-devexpress-dot-xtracharts-dot-axisxbase.md

latest3.1 KB
Original Source

AxisXBase.StickToEdge Property

Gets or sets the value that specifies whether the visual range sticks to the whole range’s start or end.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool StickToEdge { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property StickToEdge As Boolean

Property Value

TypeDescription
Boolean

true if the visual range sticks to the whole range’s edge; otherwise false.

|

Remarks

The following table demonstrates the possible values:

Note

When the property is set to true , the visual range’s range stays constant.

|

Description

|

Sample Image

| | --- | --- | |

StickToEdge = false

|

| |

StickToEdge = true;

The Visual Range is at the end of the Whole Range.

|

| |

StickToEdge = true;

The Visual Range is at the start of the Whole Range.

|

|

Example

If you specify the maximum value of an x-axis’s visual range (for example, via the Range.Set MinMaxValues method) and the StickToEdge property is enabled, you should also define the Range.SideMarginsValue property.

csharp
XYDiagram diagram = chartControl1.Diagram as XYDiagram;
diagram.DependentAxesYRange = DevExpress.Utils.DefaultBoolean.True;
diagram.AxisX.StickToEdge = true;
diagram.AxisX.WholeRange.SideMarginsValue = 2;
diagram.AxisX.VisualRange.SetMinMaxValues((double)diagram.AxisX.WholeRange.MaxValue - 20, diagram.AxisX.WholeRange.MaxValue);
vb
Dim diagram As XYDiagram = TryCast(chartControl1.Diagram, XYDiagram)
diagram.DependentAxesYRange = DevExpress.Utils.DefaultBoolean.True
diagram.AxisX.StickToEdge = True
diagram.AxisX.WholeRange.SideMarginsValue = 2
diagram.AxisX.VisualRange.SetMinMaxValues(CDbl(diagram.AxisX.WholeRange.MaxValue) - 20, diagram.AxisX.WholeRange.MaxValue)

See Also

Axis Ranges

AxisXBase Class

AxisXBase Members

DevExpress.XtraCharts Namespace