Copyright | (c) Tim Docker 2010 2014 |
---|---|
License | BSD-style (see chart/COPYRIGHT) |
Safe Haskell | None |
Language | Haskell98 |
Calculate and render time axes
Synopsis
- type TimeSeq = UTCTime -> ([UTCTime], [UTCTime])
- type TimeLabelFn = UTCTime -> String
- data TimeLabelAlignment
- class TimeValue t where
- utctimeFromTV :: t -> UTCTime
- tvFromUTCTime :: UTCTime -> t
- doubleFromTimeValue :: t -> Double
- timeValueFromDouble :: Double -> t
- timeValueAxis :: TimeValue t => TimeSeq -> TimeSeq -> TimeLabelFn -> TimeLabelAlignment -> TimeSeq -> TimeLabelFn -> TimeLabelAlignment -> AxisFn t
- autoTimeValueAxis :: TimeValue t => AxisFn t
- days :: TimeSeq
- months :: TimeSeq
- years :: TimeSeq
Documentation
type TimeSeq = UTCTime -> ([UTCTime], [UTCTime]) Source #
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 = UTCTime -> String Source #
How to display a time
data TimeLabelAlignment Source #
Instances
Show TimeLabelAlignment Source # | |
Defined in Graphics.Rendering.Chart.Axis.Time showsPrec :: Int -> TimeLabelAlignment -> ShowS # show :: TimeLabelAlignment -> String # showList :: [TimeLabelAlignment] -> ShowS # |
class TimeValue t where Source #
A typeclass abstracting the functions we need
to be able to plot against an axis of time type d
.
utctimeFromTV :: t -> UTCTime Source #
tvFromUTCTime :: UTCTime -> t Source #
doubleFromTimeValue :: t -> Double Source #
timeValueFromDouble :: Double -> t Source #
Instances
TimeValue LocalTime Source # | |
Defined in Graphics.Rendering.Chart.Axis.Time utctimeFromTV :: LocalTime -> UTCTime Source # tvFromUTCTime :: UTCTime -> LocalTime Source # | |
TimeValue UTCTime Source # | |
Defined in Graphics.Rendering.Chart.Axis.Time utctimeFromTV :: UTCTime -> UTCTime Source # tvFromUTCTime :: UTCTime -> UTCTime Source # doubleFromTimeValue :: UTCTime -> Double Source # timeValueFromDouble :: Double -> UTCTime Source # | |
TimeValue Day Source # | |
Defined in Graphics.Rendering.Chart.Axis.Time utctimeFromTV :: Day -> UTCTime Source # tvFromUTCTime :: UTCTime -> Day Source # doubleFromTimeValue :: Day -> Double Source # timeValueFromDouble :: Double -> Day Source # |
:: TimeValue t | |
=> 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 |
-> TimeLabelAlignment | |
-> AxisFn t |
autoTimeValueAxis :: TimeValue t => AxisFn t Source #
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 doubleFromTimeValue
.