Skip to main content
All docs
V25.1
  • Range.EndSideMargin Property

    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.1.dll

    NuGet Package: DevExpress.Charts

    #Declaration

    public double EndSideMargin { get; set; }

    #Property Value

    Type Description
    Double

    The side margin value, in units specified by SideMarginSizeUnit.

    #Remarks

    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.

    #Specify Margins in Axis Units

    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;
    

    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

    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.EndSideMargin = 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 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.

    See Also