corelibraries-devexpress-dot-xtracharts-dot-axisxbase.md
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
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool StickToEdge { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property StickToEdge As Boolean
| Type | Description |
|---|---|
| Boolean |
true if the visual range sticks to the whole range’s edge; otherwise false.
|
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.
|
|
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.
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);
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