Safe Haskell | None |
---|
Graphics.Rendering.Chart.Axis
Description
- data Axis = Axis {
- axis_viewport :: Range -> Double -> Double
- axis_title :: String
- axis_ticks :: [(Double, Double)]
- axis_labels :: [(Double, String)]
- axis_grid :: [Double]
- axis_label_gap :: Double
- axis_title_style :: CairoFontStyle
- axis_line_style :: CairoLineStyle
- axis_label_style :: CairoFontStyle
- axis_grid_style :: CairoLineStyle
- type AxisFn = [Double] -> Maybe Axis
- type AxesFn = [Double] -> [Double] -> (Maybe Axis, Maybe Axis)
- data AxisT = AxisT RectEdge Axis
- minsizeAxis :: AxisT -> CRender RectSize
- axisOverhang :: AxisT -> CRender (Double, Double)
- renderAxis :: AxisT -> Rect -> CRender ()
- axisMapping :: AxisT -> Rect -> (Double, Double, Double, Double, Vector, Double -> Point)
- renderAxisGrid :: Rect -> AxisT -> CRender ()
- steps :: Double -> Range -> [Rational]
- chooseStep :: Double -> Range -> Rational
- explicitAxis :: Maybe Axis -> AxisFn
- autoAxis :: (Double -> [Char]) -> ((Double, Double) -> Range -> Double -> Double) -> ([Rational], [Rational], [Rational]) -> Axis -> Maybe Axis
- data LinearAxisParams = LinearAxisParams {
- la_labelf :: Double -> String
- la_nLabels :: Int
- la_nTicks :: Int
- la_gridAtMinor :: Bool
- defaultLinearAxis :: LinearAxisParams
- autoScaledAxis' :: LinearAxisParams -> Axis -> AxisFn
- autoScaledAxis :: Axis -> AxisFn
- showD :: Show a => a -> [Char]
- log10 :: Floating a => a -> a
- frac :: (Integral t, RealFrac t1) => t1 -> (t, t1)
- lmap :: (Double, Double) -> Range -> Double -> Double
- logTicks :: Range -> ([Rational], [Rational], [Rational])
- autoScaledLogAxis' :: (Double -> String) -> Axis -> AxisFn
- autoScaledLogAxis :: Axis -> AxisFn
- independentAxes :: AxisFn -> AxisFn -> AxesFn
- linkedAxes :: AxisFn -> AxesFn
- linkedAxes' :: AxisFn -> AxesFn
- defaultAxisLineStyle :: CairoLineStyle
- defaultGridLineStyle :: CairoLineStyle
- defaultAxis :: Axis
- doubleFromLocalTime :: LocalTime -> Double
- localTimeFromDouble :: Double -> LocalTime
- type TimeSeq = LocalTime -> ([LocalTime], [LocalTime])
- coverTS :: Ord a => (a -> ([a], [a])) -> a -> a -> [a]
- enumerateTS :: Ord a => (a -> ([a], [a])) -> a -> a -> [a]
- elemTS :: Eq a => a -> (a -> (t, [a])) -> Bool
- type TimeLabelFn = LocalTime -> String
- timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> Axis -> AxisFn
- days :: TimeSeq
- months :: TimeSeq
- years :: TimeSeq
- autoTimeAxis :: Axis -> AxisFn
Documentation
The concrete data type for an axis
Constructors
Axis | |
Fields
|
type AxisFn = [Double] -> Maybe AxisSource
Function type to generate an optional axis given a set of points to be plotted against that axis.
type AxesFn = [Double] -> [Double] -> (Maybe Axis, Maybe Axis)Source
Function type to generate a pair of axes (either top and bottom, or left and right), given the set of points to be plotted against each of them.
axisOverhang :: AxisT -> CRender (Double, Double)Source
Calculate the amount by which the labels extend beyond the ends of the axis
renderAxis :: AxisT -> Rect -> CRender ()Source
renderAxisGrid :: Rect -> AxisT -> CRender ()Source
chooseStep :: Double -> Range -> RationalSource
explicitAxis :: Maybe Axis -> AxisFnSource
Explicitly specify an axis
autoAxis :: (Double -> [Char]) -> ((Double, Double) -> Range -> Double -> Double) -> ([Rational], [Rational], [Rational]) -> Axis -> Maybe AxisSource
data LinearAxisParams Source
Constructors
LinearAxisParams | |
Fields
|
autoScaledAxis' :: LinearAxisParams -> Axis -> AxisFnSource
Generate a linear axis automatically. The supplied axis is used as a template, with the viewport, ticks, labels and grid set appropriately for the data displayed against that axies. The resulting axis will only show a grid if the template has some grid values.
autoScaledAxis :: Axis -> AxisFnSource
autoScaledLogAxis' :: (Double -> String) -> Axis -> AxisFnSource
Generate a log axis automatically. The supplied axis is used as a template, with the viewport, ticks, labels and grid set appropriately for the data displayed against that axies. The resulting axis will only show a grid if the template has some grid values.
independentAxes :: AxisFn -> AxisFn -> AxesFnSource
Show independent axes on each side of the layout
linkedAxes :: AxisFn -> AxesFnSource
Show the same axis on both sides of the layout
linkedAxes' :: AxisFn -> AxesFnSource
Show the same axis on both sides of the layout, but with labels only on the primary side
doubleFromLocalTime :: LocalTime -> DoubleSource
Map a LocalTime value to a plot cordinate
localTimeFromDouble :: Double -> LocalTimeSource
Map a plot cordinate to a LocalTime
type TimeSeq = LocalTime -> ([LocalTime], [LocalTime])Source
TimeSeq is a (potentially infinite) set of times. When passes 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.
enumerateTS :: Ord a => (a -> ([a], [a])) -> a -> a -> [a]Source
type TimeLabelFn = LocalTime -> StringSource
How to display a time
timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> Axis -> AxisFnSource
Create an AxisFn
to for a time axis. The first TimeSeq
sets the minor ticks,
and the ultimate range will aligned to it's elements. The second TimeSeq
sets
the labels and grid. The TimeLabelFn
is used to format LocalTimes for labels.
The values to be plotted against this axis can be created with doubleFromLocalTime
autoTimeAxis :: Axis -> AxisFnSource
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