Skip to main content

Range.SideMarginSizeUnit Property

Specifies the measurement unit for diagram side margins.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public SideMarginSizeUnit SideMarginSizeUnit { get; set; }

Property Value

Type Description
SideMarginSizeUnit

A SideMarginSizeUnit enumeration value.

Available values:

Name Description
AxisUnit

Side margins are specified in axis measurement units.

AxisRangePercentage

Side margins are specified as a percentage.

Remarks

Use the SideMarginSizeUnit property to specify measurement units for the Range.SideMarginsValue, Range.StartSideMargin, and Range.EndSideMargin properties’ values.

Example

This example demonstrates how to specify diagram side margins as a percentage:

Use the following code to set side margins in markup:

<dxc:ChartControl ... >
    <dxc:XYDiagram2D>
        <dxc:XYDiagram2D.AxisX>
            <dxc:AxisX2D ...>
                <dxc:AxisX2D.WholeRange>
                    <dxc:Range StartSideMargin="20" EndSideMargin="0"
                               SideMarginSizeUnit="AxisRangePercentage"/>
                </dxc:AxisX2D.WholeRange>
            </dxc:AxisX2D>
        </dxc:XYDiagram2D.AxisX>
    </dxc:XYDiagram2D>
    ...
</dxc:ChartControl>

The code below shows how to specify margins at runtime:

Range range = new Range();
xAxis.WholeRange = range;
range.SideMarginSizeUnit = SideMarginSizeUnit.AxisRangePercentage;
range.StartSideMargin = 20;
range.EndSideMargin = 0;

Related API members:

Member

Description

Range.SideMarginSizeUnit

Sets the measurement unit for side margins.

Range.StartSideMargin

Specifies the left margin.

Range.EndSideMargin

Specifies the right margin.

See Also