SChartDateFrequency Class Reference

Inherits from NSObject
Conforms to NSCopying
Declared in SChartDateFrequency.h
Availability
Related samples

Overview

An SChartDateFrequency is used to specify the desired frequency of tick marks on a SChartDateTimeAxis. For example, a frequency of 2 hours will cause the axis to attempt to display a tick mark at every 2 hour mark. No class type other than SChartDateFrequency (or one of its subclasses) may be used to define a date frequency on the axis.

A frequency of a particular calendar unit may be set from one of the following supported units: year, month, week, day, hour, minute, second. This can be done by either:

  • Initialising an SChartDateFrequency object, then using the setter method for the appropriate unit of time (as listed above).
  • Using one of the convenience init methods provided (such as initWithSecond:).
  • Using one of the factory methods provided (such as dateFrequencyWithSecond:).

A frequency can only be specified in terms of one type of calendar unit. For example - a frequency of 1 hour AND 3 minutes cannot be set. In this case the frequency can only be of the type hour or of the type minute and will be set to the last component specified. To specify partial units it is necessary to use the lowest denominator - in the case of 1 hour and 3 minutes we would create a frequency of 63 minutes.

If an attempt is made to set frequency to a negative or zero value, a default of 1 for the given component will be set. For example, if an attempt is made to set a frequency of -9 years the actual frequency set will be 1 year.

Once the frequency is created, it is given a frequency denomination. The available frequency denominations are:

  • SChartDateFrequencyDenominationSeconds: Configures the frequency denomination of the date frequency object to be seconds.
  • SChartDateFrequencyDenominationMinutes: Configures the frequency denomination of the date frequency object to be minutes.
  • SChartDateFrequencyDenominationHours: Configures the frequency denomination of the date frequency object to be hours.
  • SChartDateFrequencyDenominationDays: Configures the frequency denomination of the date frequency object to be days.
  • SChartDateFrequencyDenominationWeeks: Configures the frequency denomination of the date frequency object to be weeks.
  • SChartDateFrequencyDenominationMonths: Configures the frequency denomination of the date frequency object to be months.
  • SChartDateFrequencyDenominationYears: Configures the frequency denomination of the date frequency object to be years.

Properties

denomination

Returns the frequency denomination of the date frequency object.

@property (nonatomic, assign) SChartDateFrequencyDenomination denomination

Discussion

The available denominations are:

  • SChartDateFrequencyDenominationSeconds: Configures the frequency denomination of the date frequency object to be seconds.
  • SChartDateFrequencyDenominationMinutes: Configures the frequency denomination of the date frequency object to be minutes.
  • SChartDateFrequencyDenominationHours: Configures the frequency denomination of the date frequency object to be hours.
  • SChartDateFrequencyDenominationDays: Configures the frequency denomination of the date frequency object to be days.
  • SChartDateFrequencyDenominationWeeks: Configures the frequency denomination of the date frequency object to be weeks.
  • SChartDateFrequencyDenominationMonths: Configures the frequency denomination of the date frequency object to be months.
  • SChartDateFrequencyDenominationYears: Configures the frequency denomination of the date frequency object to be years.

Declared In

SChartDateFrequency.h

weekOfMonth

The specified number of weeks in a month - see NSDateComponent.weekOfMonth for more details.

@property (nonatomic, assign) NSInteger weekOfMonth

Declared In

SChartDateFrequency.h

weekOfYear

The specified number of weeks in a year - see NSDateComponent.weekOfYear for more details.

@property (nonatomic, assign) NSInteger weekOfYear

Declared In

SChartDateFrequency.h

Class Methods

dateFrequencyWithDay:

Returns a new date frequency object, with a frequency of the specified number of days.

+ (instancetype)dateFrequencyWithDay:(NSInteger)newDay

Parameters

newDay

The frequency to use, in days.

Declared In

SChartDateFrequency.h

dateFrequencyWithHour:

Returns a new date frequency object, with a frequency of the specified number of hours.

+ (instancetype)dateFrequencyWithHour:(NSInteger)newHour

Parameters

newHour

The frequency to use, in hours.

Declared In

SChartDateFrequency.h

dateFrequencyWithMinute:

Returns a new date frequency object, with a frequency of the specified number of minutes.

+ (instancetype)dateFrequencyWithMinute:(NSInteger)newMinute

Parameters

newMinute

The frequency to use, in minutes.

Declared In

SChartDateFrequency.h

dateFrequencyWithMonth:

Returns a new date frequency object, with a frequency of the specified number of months.

+ (instancetype)dateFrequencyWithMonth:(NSInteger)newMonth

Parameters

newMonth

The frequency to use, in months.

Declared In

SChartDateFrequency.h

dateFrequencyWithSecond:

Returns a new date frequency object, with a frequency of the specified number of seconds.

+ (instancetype)dateFrequencyWithSecond:(NSInteger)newSecond

Parameters

newSecond

The frequency to use, in seconds.

Declared In

SChartDateFrequency.h

dateFrequencyWithWeekOfMonth:

Returns a new date frequency object, with a frequency of the specified number of weeks.

+ (instancetype)dateFrequencyWithWeekOfMonth:(NSInteger)newWeek

Parameters

newWeek

The frequency to use, in weeks.

Declared In

SChartDateFrequency.h

dateFrequencyWithWeekOfYear:

Returns a new date frequency object, with a frequency of the specified number of weeks.

+ (instancetype)dateFrequencyWithWeekOfYear:(NSInteger)newWeek

Parameters

newWeek

The frequency to use, in weeks.

Declared In

SChartDateFrequency.h

dateFrequencyWithYear:

Returns a new date frequency object, with a frequency of the specified number of years.

+ (instancetype)dateFrequencyWithYear:(NSInteger)newYear

Parameters

newYear

The frequency to use, in years.

Declared In

SChartDateFrequency.h

Instance Methods

initWithDay:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of days.

- (instancetype)initWithDay:(NSInteger)newDay

Parameters

newDay

The frequency of the new object, in days.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

initWithHour:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of hours.

- (instancetype)initWithHour:(NSInteger)newHour

Parameters

newHour

The frequency of the new object, in hours.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

initWithMinute:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of minutes.

- (instancetype)initWithMinute:(NSInteger)newMinute

Parameters

newMinute

The frequency of the new object, in minutes.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

initWithMonth:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of months.

- (instancetype)initWithMonth:(NSInteger)newMonth

Parameters

newMonth

The frequency of the new object, in months.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

initWithSecond:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of seconds.

- (instancetype)initWithSecond:(NSInteger)newSecond

Parameters

newSecond

The frequency of the new object, in seconds.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

initWithWeekOfMonth:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of week-of-months.

- (instancetype)initWithWeekOfMonth:(NSInteger)newWeek

Parameters

newWeek

The frequency of the new object, in weeks.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

initWithWeekOfYear:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of week-of-years.

- (instancetype)initWithWeekOfYear:(NSInteger)newWeek

Parameters

newWeek

The frequency of the new object, in weeks.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

initWithYear:

Initializes and returns a newly allocated date frequency object, with a frequency of the specified number of years.

- (instancetype)initWithYear:(NSInteger)newYear

Parameters

newYear

The frequency of the new object, in years.

Return Value

An initialized date frequency object, or nil if the object couldn’t be created.

Declared In

SChartDateFrequency.h

setDay:

Set the date frequency to have a value of the specified number of days.

- (void)setDay:(NSInteger)v

Parameters

v

The new frequency to set, in days.

Discussion

Before the new value is set, we clear any existing values in the object.

Declared In

SChartDateFrequency.h

setHour:

Set the date frequency to have a value of the specified number of hours.

- (void)setHour:(NSInteger)v

Parameters

v

The new frequency to set, in hours.

Discussion

Before the new value is set, we clear any existing values in the object.

Declared In

SChartDateFrequency.h

setMinute:

Set the date frequency to have a value of the specified number of minutes.

- (void)setMinute:(NSInteger)v

Parameters

v

The new frequency to set, in minutes.

Discussion

Before the new value is set, we clear any existing values in the object.

Declared In

SChartDateFrequency.h

setMonth:

Set the date frequency to have a value of the specified number of months.

- (void)setMonth:(NSInteger)v

Parameters

v

The new frequency to set, in months.

Discussion

Before the new value is set, we clear any existing values in the object.

Declared In

SChartDateFrequency.h

setSecond:

Set the date frequency to have a value of the specified number of seconds.

- (void)setSecond:(NSInteger)v

Parameters

v

The new frequency to set, in seconds.

Discussion

Before the new value is set, we clear any existing values in the object.

Declared In

SChartDateFrequency.h

setYear:

Set the date frequency to have a value of the specified number of years.

- (void)setYear:(NSInteger)v

Parameters

v

The new frequency to set, in years.

Discussion

Before the new value is set, we clear any existing values in the object.

Declared In

SChartDateFrequency.h