Back to Devexpress

DateTimeScaleOptions Class

corelibraries-devexpress-dot-xtracharts-d49c5df5.md

latest6.0 KB
Original Source

DateTimeScaleOptions Class

Contains settings for an axis scale when its data type is date-time.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public sealed class DateTimeScaleOptions :
    ScaleOptionsBase,
    IDateTimeScaleOptions,
    IScaleOptionsDivisionModeSupport<DateTimeMeasureUnitNative>,
    IScaleOptionsBase<DateTimeMeasureUnitNative>,
    IScaleOptionsBase,
    IXtraSupportDeserializeCollectionItem
vb
Public NotInheritable Class DateTimeScaleOptions
    Inherits ScaleOptionsBase
    Implements IDateTimeScaleOptions,
               IScaleOptionsDivisionModeSupport(Of DateTimeMeasureUnitNative),
               IScaleOptionsBase(Of DateTimeMeasureUnitNative),
               IScaleOptionsBase,
               IXtraSupportDeserializeCollectionItem

The following members return DateTimeScaleOptions objects:

Remarks

An object of the DateTimeScaleOptions type is returned by the AxisBase.DateTimeScaleOptions property.

Example

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:

csharp
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;
vb
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:

MemberDescription
AxisBase.DateTimeScaleOptionsStores the options that define the behavior of a scale when its type is date-time.
ScaleOptionsBase.ScaleModeGets or sets the scale mode for an axis.
ScaleModeLists the values that specify the scale mode for an axis.
DateTimeScaleOptions.MeasureUnitGets or sets the detail level for date-time values.
DateTimeMeasureUnitLists the values that specify the detail level for date-time values.
ScaleGridOptionsBase.GridOffsetGets or sets the offset of grid lines and major tickmarks.
ScaleGridOptionsBase.AggregateFunctionGets or sets the value indicating the aggregate function that should be used to relieve data.
AggregateFunctionLists the values that specify the aggregate function used for an axis.
DateTimeScaleOptions.GridAlignmentGets or sets the date-time measure unit to which the beginning of an axis’ gridlines and labels should be aligned.
DateTimeGridAlignmentLists the values that specify the date-time measurement unit, to which the beginning of a diagram’s gridlines and labels should be aligned.
ScaleGridOptionsBase.GridSpacingGets or sets the interval between grid lines and major tickmarks.

Implements

IXtraSupportDeserializeCollectionItem

Inheritance

Object ChartElement ScaleGridOptionsBase ScaleOptionsBase DateTimeScaleOptions

See Also

DateTimeScaleOptions Members

DevExpress.XtraCharts Namespace