This example customizes the appearance and behavior of the date-time axis in a WinForms Chart. It displays a panel with combo boxes that allow you to switch the X-axis between different date-time scale modes and specify related settings.
The Scale Mode combo box specifies a scale mode for the X-axis:
-
Manual
In the manual mode, you can configure the following axis settings:
- DateTimeScaleOptions.GridAlignment - specifies the alignment of grid lines and labels to a particular date-time value (e.g., start of month, start of year).
- DateTimeScaleOptions.MeasureUnit - specifies the time unit (for example, day, month, year) used to measure intervals along the axis.
- ScaleGridOptionsBase.AggregateFunction - specifies the aggregate function (for example, MIN, MAX, AVG, SUM, etc.).
AxisX.DateTimeScaleOptions.ScaleMode = ScaleMode.Manual;
-
Automatic
The chart automatically determines date-time scale settings and applies an appropriate aggregation function. In this mode, you can specify the aggregate function.
AxisX.DateTimeScaleOptions.ScaleMode = ScaleMode.Automatic;
-
Continuous
Disables axis intervals and data aggregation. You can set the alignment of grid lines and labels to a specific date-time value.
AxisX.DateTimeScaleOptions.ScaleMode = ScaleMode.Continuous;
(you will be redirected to DevExpress.com to submit your response)