Skip to main content

DateTimeOptions.Format Property

Gets or sets a value that specifies the form of date-time values’ representation.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v23.2.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public DateTimeFormat Format { get; set; }

Property Value

Type Description
DateTimeFormat

A DateTimeFormat enumeration value.

Available values:

Name Description
ShortDate

Displays a date using the short-date format specified in your computer’s regional settings.

LongDate

Displays a date using the long-date format specified in your computer’s regional settings.

ShortTime

Displays a time using the short-time format specified in your computer’s regional settings.

LongTime

Displays a time using the long-time format specified in your computer’s regional settings.

General

Displays a date and time, using the general date-time settings determined by your computer’s regional settings.

MonthAndDay

Displays a date as a month name and day number, using your computer’s regional settings (e.g., February 11).

MonthAndYear

Displays a date as a month name and year number, using your computer’s regional settings (e.g., February, 2006).

QuarterAndYear

Displays a date as a quarter value and year number using your computer’s regional settings (e.g., Q2 2006).

Note that you can apply formatting to the quarter’s value. To do this, set the DateTimeOptions.Format property to Custom, and define one of the following values for the DateTimeOptions.FormatString property:

q - Changes format to Roman numerals (e.g., IV);

qq - Changes format to Roman numerals with the Q prefix (e.g., QIV);

Q - Changes format to Arabic numerals (e.g., 4);

QQ - Changes format to Arabic numerals with the Q prefix (e.g., Q4).

Custom

The format string specified by the DateTimeOptions.FormatString property will be applied.

Property Paths

You can access this nested property as listed below:

Object Type Path to Format
PointOptions
PointOptions

Remarks

Use the Format property, to define the appropriate format for date-time values representation in the axis labels, series point labels or in the legend.

If the Format property is set to DateTimeFormat.Custom, the DateTimeOptions.FormatString property is used to determine the date-time format.

Example

The following example demonstrates how to modify the DateTimeOptions.Format property value in XAML.

<dxc:XYDiagram2D.AxisX>
    <dxc:AxisX2D>
        <dxc:AxisX2D.Label>
            <dxc:AxisLabel TextPattern="{}{A:MMMM d}"/>
        </dxc:AxisX2D.Label>
    </dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>
See Also