corelibraries-devexpress-dot-xtracharts-dot-range-8dffcca0.md
Gets or sets the distance between the series point with the highest value and the end of the axis range.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public double EndSideMargin { get; set; }
Public Property EndSideMargin As Double
| Type | Description |
|---|---|
| Double |
The side margin value, in units specified by SideMarginSizeUnit.
|
Use the WholeRange and VisualRange properties to access the EndSideMargin property. To specify the margin on the opposite side, use StartSideMargin. Set the Range.SideMarginsValue property to define both side margins.
The following images show a chart with different EndSideMargin values (the x-axis measurement unit is Hour):
| Property Value | Example |
|---|---|
| WholeRange.EndSideMargin = 5 (Hours) | |
| (WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisUnit) | |
| WholeRange.EndSideMargin = 0 (Hours) | |
| (WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisUnit) |
XYDiagram diagram = chart.Diagram as XYDiagram;
diagram.AxisX.WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisUnit;
diagram.AxisX.WholeRange.EndSideMargin = 5;
Dim diagram As XYDiagram = TryCast(chart.Diagram, XYDiagram)
diagram.AxisX.WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisUnit
diagram.AxisX.WholeRange.EndSideMargin = 5
Note: If you set EndSideMargin or StartSideMargin, the control ignores the Range.AutoSideMargins property.
When the SideMarginSizeUnit property is set to AxisUnit , side margins are specified in axis measurement units (NumericScaleOptions.MeasureUnit, DateTimeScaleOptions.MeasureUnit, or TimeSpanScaleOptions.MeasureUnit). These axis measurement units vary according to the axis type.
|
Axis Type
|
Axis Mode
|
Default Measurement Unit
| | --- | --- | --- | |
Date-time
|
Continuous
|
DateTimeMeasureUnit.Millisecond
| |
Date-time
|
Automatic, Manual, Interval
|
| |
Time-span
|
Continuous
|
TimeSpanMeasureUnit.Millisecond
| |
Time-span
|
Automatic, Manual, Interval
|
| |
Numerical
|
Automatic, Continuous, Manual, Interval
|
| |
Qualitative
| |
Ones
|
Set the Range.SideMarginSizeUnit property to SideMarginSizeUnit.AxisRangePercentage to define a margin value as a percentage of the axis range, for example:
XYDiagram diagram = chart.Diagram as XYDiagram;
diagram.AxisX.WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisRangePercentage;
diagram.AxisX.WholeRange.EndSideMargin = 20;
Dim diagram As XYDiagram = TryCast(chart.Diagram, XYDiagram)
diagram.AxisX.WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisRangePercentage
diagram.AxisX.WholeRange.EndSideMargin = 20
If the Axis.Reverse property is enabled (axis values are arranged in reversed order), side margins change their positions. As a result, the end margin is displayed at the left (for an x-axis) or bottom (for a y-axis) of the diagram.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the EndSideMargin 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.
diagram.AxisX.Label.ResolveOverlappingOptions.AllowStagger = false;
diagram.AxisX.VisualRange.EndSideMargin = 200;
diagram.DependentAxesYRange = DefaultBoolean.True;
diagram.AxisX.Label.ResolveOverlappingOptions.AllowStagger = False
diagram.AxisX.VisualRange.EndSideMargin = 200
diagram.DependentAxesYRange = DefaultBoolean.True
See Also