Back to Devexpress

DateTimeLabelFormat Class

mobilecontrols-devexpress-dot-xamarinforms-dot-charts-8264b837.md

latest2.6 KB
Original Source

DateTimeLabelFormat Class

Stores the date-time axis label format for the specified measurement unit.

Namespace : DevExpress.XamarinForms.Charts

Assembly : DevExpress.XamarinForms.Charts.dll

NuGet Package : DevExpress.XamarinForms.Charts

Declaration

csharp
public class DateTimeLabelFormat :
    BindableObject

Remarks

The ChartView can detect if adjacent date-time argument values belong to different time intervals (for example, days of different months) and automatically display a transition label on a date-time axis (for example, the first-day label of the next month) with a different format.

To enable this functionality:

  1. Set the DateTimeAxisX.LabelFormatAutoReplaceOptions property to an AxisLabelFormatAutoReplaceOptions object.
  2. Add DateTimeLabelFormat objects that specify label formats (Format) for arguments of different measurement units (MeasureUnit) to the AxisLabelFormatAutoReplaceOptions.LabelFormats collection.

Example

The following example configures a date-time axis so that it automatically shows when the next month starts:

xml
<dxc:DateTimeAxisX x:Name="xAxis" GridAlignment="Day" GridSpacing="5">
    <dxc:DateTimeAxisX.LabelFormatAutoReplaceOptions>
        <dxc:AxisLabelFormatAutoReplaceOptions>
            <dxc:DateTimeLabelFormat MeasureUnit="Day" Format="d"/>
            <dxc:DateTimeLabelFormat MeasureUnit="Month" Format="MMM, d"/>
        </dxc:AxisLabelFormatAutoReplaceOptions>
    </dxc:DateTimeAxisX.LabelFormatAutoReplaceOptions>
</dxc:DateTimeAxisX>

Inheritance

Object DateTimeLabelFormat

See Also

DateTimeLabelFormat Members

DevExpress.XamarinForms.Charts Namespace