ContEx v0.3.0 Contex.TimeScale View Source

A time scale to map date and time data to a plotting coordinate system.

Almost identical Contex.ContinuousLinearScale in terms of concepts and usage, except it applies to DateTime and NaiveDateTime domain data types.

TimeScale handles the complexities of calculating nice tick intervals etc for almost any time range between a few seconds and a few years.

Link to this section Summary

Functions

Define the data domain for the scale from a list of data.

Define the data domain for the scale

Specifies the number of intervals the scale should display.

Creates a new TimeScale struct with basic defaults set

Link to this section Types

Link to this type

t()

View Source
t() :: %Contex.TimeScale{
  custom_tick_formatter: term(),
  display_format: term(),
  domain: term(),
  interval_count: term(),
  nice_domain: term(),
  range: term(),
  tick_interval: term()
}

Link to this section Functions

Link to this function

domain(scale, data)

View Source
domain(t(), [datetimes()]) :: t()

Define the data domain for the scale from a list of data.

Extents will be calculated by the scale.

Link to this function

domain(scale, min, max)

View Source
domain(t(), datetimes(), datetimes()) :: t()

Define the data domain for the scale

Link to this function

interval_count(scale, interval_count)

View Source
interval_count(t(), integer()) :: t()

Specifies the number of intervals the scale should display.

Default is 10.

Creates a new TimeScale struct with basic defaults set