Back to Devexpress

Range.SideMarginsValue Property

corelibraries-devexpress-dot-xtracharts-dot-range-858d2567.md

latest7.3 KB
Original Source

Range.SideMarginsValue Property

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

Declaration

csharp
public double SideMarginsValue { get; set; }
vb
Public Property SideMarginsValue As Double

Property Value

TypeDescription
Double

The side margins value, in the axis’ current measurement unit.

|

Remarks

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 ValueExample
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.

Example:

The following code removes side margins.

csharp
XYDiagram diagram = chartControl1.Diagram as XYDiagram;
diagram.AxisX.WholeRange.SideMarginsValue = 0;
vb
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

csharp
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

csharp
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

csharp
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

vb
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

vb
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

vb
diagram.AxisX.Label.ResolveOverlappingOptions.AllowStagger = False
diagram.AxisX.WholeRange.SideMarginsValue = 0
diagram.DependentAxesYRange = DefaultBoolean.True

See Also

Range Class

Range Members

DevExpress.XtraCharts Namespace