TimeSpanScaleOptions.MeasureUnit Property
Gets or sets the detail level for time-span values.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.2.dll
NuGet Package: DevExpress.Charts
#Declaration
public TimeSpanMeasureUnit MeasureUnit { get; set; }
#Property Value
Type | Description |
---|---|
Time |
A value that represents the axis detail level. |
Available values:
Name | Description |
---|---|
Millisecond | Specifies a millisecond as the measurement unit for time-span values. |
Second | Specifies a second as the measurement unit for time-span values. |
Minute | Specifies a minute as the measurement unit for time-span values. |
Hour | Specifies an hour as the measurement unit for time-span values. |
Day | Specifies a day as the measurement unit for time-span values. |
#Property Paths
You can access this nested property as listed below:
Object Type | Path to Measure |
---|---|
Axis |
|
#Remarks
This property is available when the SeriesBase.ArgumentScaleType or SeriesBase.ValueScaleType property is set to TimeSpan, and the ScaleOptionsBase.ScaleMode property is set to Manual.
Time |
Time |
---|---|
![]() |
![]() |
Note
To access Time
To define a time-span measurement unit to which the beginning of a diagram’s gridlines and labels should be aligned, use the TimeSpanScaleOptions.GridAlignment property.
#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 |
---|---|
Scale |
Gets or sets the scale mode for an axis. |
Time |
Gets or sets the detail level for time-span values. |
Scale |
Gets or sets the value indicating the aggregate function that should be used to relieve data. |
Scale |
Gets or sets the interval between grid lines and major tickmarks. |