corelibraries-devexpress-dot-xtracharts-dot-range-858d2567.md
Specifies the space between the outermost series point and the diagram’s edge.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public double SideMarginsValue { get; set; }
Public Property SideMarginsValue As Double
| Type | Description |
|---|---|
| Double |
The side margins value, in the axis’ current measurement unit.
|
The SideMarginsValue property allows you to specify the space between the outermost series points and the diagram’s edge. You can access the SideMarginsValue property via an axis’s WholeRange and VisualRange properties.
| Property Value | Example |
|---|---|
| WholeRange.SideMarginsValue = 200 | |
| WholeRange.SideMarginsValue = 0 |
When you use the SideMarginsValue property to specify side margins, this resets the Range.AutoSideMargins property.
The SideMarginsValue property value is measured in axis measurement units.
AxisBase‘s DateTimeScaleOptions.MeasureUnit property specifies the current measurement unit for an axis that measures date-time values. The current measurement unit is DateTimeMeasureUnit.Millisecond for the date-time axis whose mode (AxisBase‘s DateTimeScaleOptions.ScaleMode) is ScaleMode.Continuous. The default measurement unit is Day for other scale modes.
AxisBase‘s NumericScaleOptions.MeasureUnit property specifies the current measurement unit for an axis that measures numeric values. The default measurement unit is NumericMeasureUnit.Ones for the numeric axis.
AxisBase‘s TimeSpanScaleOptions.MeasureUnit property specifies the current measurement unit for an axis that measures time-span values. The current measurement unit is TimeSpanMeasureUnit.Millisecond for the time-span axis whose mode (AxisBase‘s TimeSpanScaleOptions.ScaleMode) is ScaleMode.Continuous. The default measurement unit is Second for other scale modes.
Refer to Visual Ranges and Whole Ranges for more information about ranges.
The following code removes side margins.
XYDiagram diagram = chartControl1.Diagram as XYDiagram;
diagram.AxisX.WholeRange.SideMarginsValue = 0;
Dim diagram As XYDiagram = TryCast(chartControl1.Diagram, XYDiagram)
diagram.AxisX.WholeRange.SideMarginsValue = 0
The following code snippets (auto-collected from DevExpress Examples) contain references to the SideMarginsValue 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.
winforms-charts-plot-xy-series-with-histogram/CS/Form1.cs#L42
diagram.AxisX.WholeRange.MaxValue = MaxValue;
diagram.AxisX.WholeRange.SideMarginsValue = 0;
diagram.AxisX.NumericScaleOptions.IntervalOptions.GridLayoutMode = GridLayoutMode.GridShiftedLabelCentered;
winforms-charts-create-model-for-custom-chart-element/CS/CustomChartElementModel/Form1.cs#L131
diagram.AxisX.DateTimeScaleOptions.GridSpacing = 9;
diagram.AxisX.WholeRange.SideMarginsValue = 1.2;
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;
winforms-charts-create-real-time-chart/CS/RealTimeChartUpdates/Form1.cs#L32
diagram.AxisX.Label.ResolveOverlappingOptions.AllowStagger = false;
diagram.AxisX.WholeRange.SideMarginsValue = 0;
diagram.DependentAxesYRange = DefaultBoolean.True;
winforms-charts-plot-xy-series-with-histogram/VB/Form1.vb#L69
diagram.AxisX.WholeRange.MaxValue = MaxValue
diagram.AxisX.WholeRange.SideMarginsValue = 0
diagram.AxisX.NumericScaleOptions.IntervalOptions.GridLayoutMode = GridLayoutMode.GridShiftedLabelCentered
winforms-charts-create-model-for-custom-chart-element/VB/CustomChartElementModel/Form1.vb#L189
diagram.AxisX.DateTimeScaleOptions.GridSpacing = 9
diagram.AxisX.WholeRange.SideMarginsValue = 1.2
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = False
winforms-charts-create-real-time-chart/VB/RealTimeChartUpdates/Form1.vb#L36
diagram.AxisX.Label.ResolveOverlappingOptions.AllowStagger = False
diagram.AxisX.WholeRange.SideMarginsValue = 0
diagram.DependentAxesYRange = DefaultBoolean.True
See Also