DateTimeAxis
struct · ferroui-controls-charts · v0.5.0
struct DateTimeAxis
A date axis whose bounds compare UTC instants and whose ticks follow calendar boundaries. Dates before the Unix epoch remain valid.
Members
TYPEto_refminimum_propertymaximum_propertyinterval_type_propertylabel_format_propertyconstructnewminimumset_minimummaximumset_maximuminterval_typeset_interval_typelabel_formatset_label_formatset_optional_label_formatresolve_rangeresolved_intervalticksformat_tick
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<DateTimeAxis>
Returns a strong reference to this object.
minimum_property
fn minimum_property() -> &'static StyledProperty<Option<DateTimeOffset>>
maximum_property
fn maximum_property() -> &'static StyledProperty<Option<DateTimeOffset>>
interval_type_property
fn interval_type_property() -> &'static StyledProperty<DateTimeIntervalType>
label_format_property
fn label_format_property() -> &'static StyledProperty<String>
construct
fn construct() -> Self
new
fn new() -> Ref<Self>
minimum
fn minimum(self: &Self) -> Option<DateTimeOffset>
set_minimum
fn set_minimum(self: &Self, value: Option<DateTimeOffset>) -> Result<(), ChartError>
maximum
fn maximum(self: &Self) -> Option<DateTimeOffset>
set_maximum
fn set_maximum(self: &Self, value: Option<DateTimeOffset>) -> Result<(), ChartError>
interval_type
fn interval_type(self: &Self) -> DateTimeIntervalType
set_interval_type
fn set_interval_type(self: &Self, value: DateTimeIntervalType)
label_format
fn label_format(self: &Self) -> String
set_label_format
fn set_label_format(self: &Self, value: impl Into<String>)
set_optional_label_format
fn set_optional_label_format(self: &Self, value: Option<&str>)
resolve_range
fn resolve_range(self: &Self, values: &[DateTimeOffset]) -> (DateTimeOffset, DateTimeOffset)
Automatic bounds use the sample instants; an empty source has a deterministic one-day range beginning at the Unix epoch.
resolved_interval
fn resolved_interval(self: &Self, minimum: DateTimeOffset, maximum: DateTimeOffset, target_tick_count: usize) -> DateTimeIntervalType
The interval of the ticks between minimum and maximum: the IntervalType, or
for Auto the calendar unit that gives about target_tick_count ticks.
ticks
fn ticks(self: &Self, minimum: DateTimeOffset, maximum: DateTimeOffset, target_tick_count: usize) -> Vec<DateTimeOffset>
Calendar-aligned ticks in UTC. Month/year ticks use calendar arithmetic, so leap days and variable-length months are preserved. Explicit daily/weekly intervals may be sampled for very large ranges; no call produces more than 4096 ticks. A daily range with fewer than two midnights in it is divided into whole minutes or hours instead.
format_tick
fn format_tick(self: &Self, value: DateTimeOffset) -> String
Formats an axis label using the framework's culture-aware date formatter. The public WinRT templates used by the source samples are translated to their framework format equivalents.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<DateTimeAxis>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.