Back to Devexpress

DateTimeScaleOptions.SkipRangesWithoutPoints Property

corelibraries-devexpress-dot-xtracharts-dot-datetimescaleoptions-16a5d40a.md

latest5.1 KB
Original Source

DateTimeScaleOptions.SkipRangesWithoutPoints Property

Specifies whether to skip axis ranges that do not have data points.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool SkipRangesWithoutPoints { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property SkipRangesWithoutPoints As Boolean

Property Value

TypeDescription
Boolean

true to skip ranges without points; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to SkipRangesWithoutPoints
AxisBase

.DateTimeScaleOptions .SkipRangesWithoutPoints

|

Remarks

Use the SkipRangesWithoutPoints option to exclude all date-time axis ranges without data points. If your goal is to display work days/time only, enable the WorkdaysOnly and WorkTimeOnly properties instead. See the following topic for more information: Work Time and Workday Configuration.

The following images show a chart with different SkipRangesWithoutPoints values:

|

Property Value

|

Example

| | --- | --- | |

SkipRangesWithoutPoints = true

|

| |

SkipRangesWithoutPoints = false (Default)

|

|

Example:

csharp
XYDiagram diagram = chartControl1.Diagram as XYDiagram;
diagram.AxisX.DateTimeScaleOptions.SkipRangesWithoutPoints = true;
vb
Dim diagram As XYDiagram = TryCast(chartControl1.Diagram, XYDiagram)
diagram.AxisX.DateTimeScaleOptions.SkipRangesWithoutPoints = True

The following example demonstrates how you can exclude weekends and holidays from the X-axis range:

View Example: Charts - How to exclude weekends and holidays from the axis range

The following code snippets (auto-collected from DevExpress Examples) contain references to the SkipRangesWithoutPoints 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-chart-create-candlestick-chart/VB/CandleStickChart/Form1.vb#L44

vb
' to avoid gaps in the chart's data.
diagram.AxisX.DateTimeScaleOptions.SkipRangesWithoutPoints = True
' Hide the range without points at the beginning of the y-axis.

winforms-chart-exclude-weekends-and-holidays-from-the-axis-range/VB/WeekendsExclusion/Form1.vb#L48

vb
' In this example, March 8th has no data points to display and is not displayed on the X-axis.
            dateTimeScaleOptions2.SkipRangesWithoutPoints = True
#End Region

See Also

Scale Breaks

Work Time and Workday Configuration

Empty Points

Axis Ranges

DateTimeScaleOptions Class

DateTimeScaleOptions Members

DevExpress.XtraCharts Namespace