Core Plot (iOS)
Cocoa plotting framework for Mac OS X and iOS
CPTTimeFormatter Class Reference

A number formatter that converts time intervals to dates. Useful for formatting labels on an axis. If you choose the numerical scale of the plot space to be in seconds, axis labels can be directly generated by setting a CPTTimeFormatter as the labelFormatter and/or minorTickLabelFormatter . More...

#import <CPTTimeFormatter.h>

+ Inheritance diagram for CPTTimeFormatter:
+ Collaboration diagram for CPTTimeFormatter:

Public Instance Methods

Initialization
(id- initWithDateFormatter:
 Initializes new instance with the date formatter passed. More...
 
(id- init [implementation]
 Initializes new instance with a default date formatter. The default formatter uses NSDateFormatterMediumStyle for dates and times. More...
 
Formatting
(NSString *) - stringForObjectValue: [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. More...
 
- Public Instance Methods inherited from NSObject
(Class- classForCoder
 
(id- copy
 
(void) - dealloc
 
(void) - finalize
 
(id- init
 
(id- mutableCopy
 
- Public Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 
- Public Instance Methods inherited from <NSCoding>
(id- initWithCoder:
 
(void) - encodeWithCoder:
 
- Public Instance Methods inherited from <NSCopying>
(id- copyWithZone:
 

Properties

NSDateFormatterdateFormatter
 The date formatter used to generate strings from time intervals. More...
 
NSDatereferenceDate
 Date from which time intervals are taken. If nil, the standard reference date (1 January 2001, GMT) is used. More...
 

Additional Inherited Members

- Public Class Methods inherited from NSObject
(id+ alloc
 
(Class+ class
 
(void) + initialize
 
(void) + load
 
(id+ new
 

Detailed Description

A number formatter that converts time intervals to dates. Useful for formatting labels on an axis. If you choose the numerical scale of the plot space to be in seconds, axis labels can be directly generated by setting a CPTTimeFormatter as the labelFormatter and/or minorTickLabelFormatter .

Method Documentation

- (id) init
implementation

Initializes new instance with a default date formatter. The default formatter uses NSDateFormatterMediumStyle for dates and times.

Returns
The new instance.
- (id) initWithDateFormatter: (NSDateFormatter *)  aDateFormatter

Initializes new instance with the date formatter passed.

Parameters
aDateFormatterThe date formatter.
Returns
The new instance.
- (NSString *) stringForObjectValue: (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
coordinateValueThe time value.
Returns
The date string.

Property Documentation

- (NSDateFormatter *) dateFormatter
readwritenonatomicretain

The date formatter used to generate strings from time intervals.

- (NSDate *) referenceDate
readwritenonatomiccopy

Date from which time intervals are taken. If nil, the standard reference date (1 January 2001, GMT) is used.


The documentation for this class was generated from the following files: