Graphics.Rendering.Chart.Axis.LocalTime

Chart-1.9.5: A library for generating 2D Charts and Plots

Copyright | (c) Tim Docker 2010 2014
License | BSD-style (see chart/COPYRIGHT)
Safe Haskell | None
Language | Haskell98

Graphics.Rendering.Chart.Axis.LocalTime

Contents

- Utilities

Description

Deprecated: Use Graphics.Rendering.Chart.Axis.Time module

Calculate and render time axes

Synopsis

- type TimeSeq = LocalTime -> ([LocalTime], [LocalTime])
- type TimeLabelFn = LocalTime -> String
- data TimeLabelAlignment
  - = UnderTicks
  - | BetweenTicks
- timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> TimeLabelAlignment -> TimeSeq -> TimeLabelFn -> TimeLabelAlignment -> AxisFn LocalTime
- autoTimeAxis :: AxisFn LocalTime
- days :: TimeSeq
- months :: TimeSeq
- years :: TimeSeq
- doubleFromLocalTime :: LocalTime -> Double

# Documentation

type TimeSeq = LocalTime -> ([LocalTime], [LocalTime]) #

TimeSeq is a (potentially infinite) set of times. When passed a reference time, the function returns a a pair of lists. The first contains all times in the set less than the reference time in decreasing order. The second contains all times in the set greater than or equal to the reference time, in increasing order.

type TimeLabelFn = LocalTime -> String #

How to display a time

data TimeLabelAlignment #

Constructors

UnderTicks |
BetweenTicks |

#### Instances

Instances details

Show TimeLabelAlignment # |
Instance details Defined in Graphics.Rendering.Chart.Axis.LocalTime Methods showsPrec :: Int -> TimeLabelAlignment -> ShowS # show :: TimeLabelAlignment -> String # showList :: [TimeLabelAlignment] -> ShowS #

timeAxis #

Arguments

:: TimeSeq | Set the minor ticks, and the final range will be aligned to its elements.
-> TimeSeq | Set the labels and grid.
-> TimeLabelFn |
-> TimeLabelAlignment |
-> TimeSeq | Set the second line of labels.
-> TimeLabelFn | Format `LocalTime` for labels.
-> TimeLabelAlignment |
-> AxisFn LocalTime |

Create an `AxisFn` to for a time axis.

The values to be plotted against this axis can be created with `doubleFromLocalTime`.

autoTimeAxis :: AxisFn LocalTime #

Automatically choose a suitable time axis, based upon the time range of data. The values to be plotted against this axis can be created with `doubleFromLocalTime`.

days :: TimeSeq #

A `TimeSeq` for calendar days.

months :: TimeSeq #

A `TimeSeq` for calendar months.

years :: TimeSeq #

A `TimeSeq` for calendar years.

# Utilities

doubleFromLocalTime :: LocalTime -> Double #

Map a LocalTime value to a plot coordinate.