Skip to main content
A newer version of this page is available. .

AxisBase.TimeSpanScaleOptions Property

Stores the settings of a scale when its type is time-span.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v22.1.dll

NuGet Package: DevExpress.Charts

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public TimeSpanScaleOptions TimeSpanScaleOptions { get; }

Property Value

Type Description
TimeSpanScaleOptions

The time-span axis scale options.

Example

The following example shows how to group minute-by-minute data into data points with a greater measurement unit (“Hour”).

To do this, you can use the following code:

private void Form1_Load(object sender, EventArgs e) {
    XYDiagram diagram = chartControl1.Diagram as XYDiagram;
    if (diagram != null) {
        diagram.AxisX.TimeSpanScaleOptions.ScaleMode = ScaleMode.Manual;
        diagram.AxisX.TimeSpanScaleOptions.MeasureUnit = TimeSpanMeasureUnit.Hour;
        diagram.AxisX.TimeSpanScaleOptions.AggregateFunction = AggregateFunction.Average;
        diagram.AxisX.TimeSpanScaleOptions.GridSpacing = 6;
        diagram.AxisX.TimeSpanScaleOptions.GridAlignment = TimeSpanGridAlignment.Hour;
    }             
}

The example uses the following API members:

Member Description
ScaleOptionsBase.ScaleMode Gets or sets the scale mode for an axis.
TimeSpanScaleOptions.MeasureUnit Gets or sets the detail level for time-span values.
ScaleGridOptionsBase.AggregateFunction Gets or sets the value indicating the aggregate function that should be used to relieve data.
ScaleGridOptionsBase.GridSpacing Gets or sets the interval between grid lines and major tickmarks.
See Also