Skip to main content

Range.StartSideMargin Property

Gets or sets the distance between the series point with the lowest value and the start of the axis range.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v23.2.dll

NuGet Package: DevExpress.Charts

Declaration

public double StartSideMargin { get; set; }

Property Value

Type Description
Double

The side margin value. SideMarginSizeUnit specifies the unit.

Remarks

Use the WholeRange and VisualRange properties to access the StartSideMargin property. To specify the margin on the opposite side, use EndSideMargin. Set the Range.SideMarginsValue property to define both side margins.

Specify Margins in Axis Units

The following images show a chart with different StartSideMargin values (the x-axis measurement unit is Hour):

Property Value Example
WholeRange.StartSideMargin = 5 (Hours)
(WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisUnit)
WholeRange.StartSideMargin = 0 (Hours)
(WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisUnit)
XYDiagram diagram = chart.Diagram as XYDiagram;
diagram.AxisX.WholeRange.SideMarginSizeUnit = SideMarginSizeUnit.AxisUnit;
diagram.AxisX.WholeRange.StartSideMargin = 5;

Note: If you set StartSideMargin or EndSideMargin, 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

DateTimeMeasureUnit.Day

Time-span

Continuous

TimeSpanMeasureUnit.Millisecond

Time-span

Automatic, Manual, Interval

TimeSpanMeasureUnit.Second

Numerical

Automatic, Continuous, Manual, Interval

NumericMeasureUnit.Ones

Qualitative

Ones

Specify Margins as a Percentage

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.StartSideMargin = 20;

Reversed Axis Margins

If the Axis.Reverse property is enabled (axis values are arranged in reversed order), side margins change their positions. As a result, the start margin is displayed at the right (for an x-axis) or top (for a y-axis) of the diagram.

See Also