corelibraries-devexpress-dot-xtracharts-dot-axisbase-7807f859.md
Stores the options that define the behavior of a scale when its type is date-time.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
[PersistenceMode(PersistenceMode.InnerProperty)]
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public DateTimeScaleOptions DateTimeScaleOptions { get; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
<PersistenceMode(PersistenceMode.InnerProperty)>
Public ReadOnly Property DateTimeScaleOptions As DateTimeScaleOptions
| Type | Description |
|---|---|
| DateTimeScaleOptions |
The date-time axis scale options.
|
This example shows how to use DateTimeScaleOptions to reduce the number of visible series points.
The following code configures the axis scale settings to resemble to the chart appearance above:
DateTimeScaleOptions dateTimeScaleOptions = ((XYDiagram)chartControl.Diagram).AxisX.DateTimeScaleOptions;
dateTimeScaleOptions.WorkdaysOnly = true;
dateTimeScaleOptions.ScaleMode = ScaleMode.Manual;
dateTimeScaleOptions.AggregateFunction = AggregateFunction.Average;
dateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Month;
dateTimeScaleOptions.GridAlignment = DateTimeGridAlignment.Quarter;
dateTimeScaleOptions.GridSpacing = 1;
Dim dateTimeScaleOptions As DateTimeScaleOptions = CType(chartControl.Diagram,XYDiagram).AxisX.DateTimeScaleOptions
dateTimeScaleOptions.WorkdaysOnly = true
dateTimeScaleOptions.ScaleMode = ScaleMode.Manual
dateTimeScaleOptions.AggregateFunction = AggregateFunction.Average
dateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Month
dateTimeScaleOptions.GridAlignment = DateTimeGridAlignment.Quarter
dateTimeScaleOptions.GridSpacing = 1
The following table lists the API members the code above uses:
| Member | Description |
|---|---|
AxisBase.DateTimeScaleOptions | Stores the options that define the behavior of a scale when its type is date-time. |
| ScaleOptionsBase.ScaleMode | Gets or sets the scale mode for an axis. |
| ScaleMode | Lists the values that specify the scale mode for an axis. |
| DateTimeScaleOptions.MeasureUnit | Gets or sets the detail level for date-time values. |
| DateTimeMeasureUnit | Lists the values that specify the detail level for date-time values. |
| ScaleGridOptionsBase.GridOffset | Gets or sets the offset of grid lines and major tickmarks. |
| ScaleGridOptionsBase.AggregateFunction | Gets or sets the value indicating the aggregate function that should be used to relieve data. |
| AggregateFunction | Lists the values that specify the aggregate function used for an axis. |
| DateTimeScaleOptions.GridAlignment | Gets or sets the date-time measure unit to which the beginning of an axis’ gridlines and labels should be aligned. |
| DateTimeGridAlignment | Lists the values that specify the date-time measurement unit, to which the beginning of a diagram’s gridlines and labels should be aligned. |
| ScaleGridOptionsBase.GridSpacing | Gets or sets the interval between grid lines and major tickmarks. |
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DateTimeScaleOptions 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-exclude-weekends-and-holidays-from-the-axis-range/VB/WeekendsExclusion/Form1.vb#L27
series1.SetFinancialDataMembers("Argument", "Low", "High", "Open", "Close")
Dim dateTimeScaleOptions As DateTimeScaleOptions = CType(chartControl1.Diagram, XYDiagram).AxisX.DateTimeScaleOptions
' Enables workday options.
See Also