A number formatter that converts calendar intervals to dates.
More...
#import <CPTCalendarFormatter.h>
A number formatter that converts calendar intervals to dates.
Useful for formatting labels on an axis. The numerical scale of the plot space will be used to increment the specified calendar unit. For example, with a majorIntervalLength of one (1
) and a referenceCalendarUnit of NSMonthCalendarUnit, successive months will be displayed on the axis. Axis labels can be directly generated by setting a CPTCalendarFormatter as the labelFormatter and/or minorTickLabelFormatter .
◆ init
- (nonnull instancetype) init |
|
|
|
|
implementation |
◆ initWithCoder:
- (nullable instancetype) initWithCoder: |
|
(nonnull NSCoder *) |
coder |
|
Returns an object initialized from data in a given unarchiver.
- Parameters
-
coder | An unarchiver object. |
- Returns
- An object initialized from data in a given unarchiver.
◆ initWithDateFormatter:
- (nonnull instancetype) initWithDateFormatter: |
|
(nullable NSDateFormatter *) |
aDateFormatter |
|
Initializes new instance with the date formatter passed.
- Parameters
-
aDateFormatter | The date formatter. |
- Returns
- The new instance.
◆ stringForObjectValue:
- (nullable NSString *) stringForObjectValue: |
|
(nullable id) |
coordinateValue |
|
|
implementation |
Converts decimal number for the time into a date string. Uses the date formatter to do the conversion. Conversions are relative to the reference date, unless it is nil, in which case the standard reference date of 1 January 2001, GMT is used.
- Parameters
-
coordinateValue | The time value. |
- Returns
- The date string.
◆ dateFormatter
The date formatter used to generate strings from date calculations.
◆ referenceCalendar
Calendar which is used for date calculations. If nil, the current calendar is used.
◆ referenceCalendarUnit
Calendar unit which is incremented in the date calculation. If zero (0
), the date is incremented.
◆ referenceDate
- (nullable NSDate *) referenceDate |
|
readwritenonatomiccopy |
Date from which time intervals are computed. If nil, the standard reference date (1 January 2001, GMT) is used.
The documentation for this class was generated from the following files: