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 | Safe-Inferred
Language | Haskell98

Graphics.Rendering.Chart.Axis.Floating

Contents

- Orphan instances

Description

Calculate and render floating value axes including doubles with linear, log, and percentage scaling.

Synopsis

- newtype Percent = Percent {
  - unPercent :: Double
  }
- data LinearAxisParams a = LinearAxisParams {
  - _la_labelf :: [a] -> [String]
  - _la_nLabels :: Int
  - _la_nTicks :: Int
  }
- newtype LogValue = LogValue {
  - unLogValue :: Double
  }
- data LogAxisParams a = LogAxisParams {
  - _loga_labelf :: [a] -> [String]
  }
- scaledAxis :: RealFloat a => LinearAxisParams a -> (a, a) -> AxisFn a
- autoScaledAxis :: RealFloat a => LinearAxisParams a -> AxisFn a
- autoScaledLogAxis :: RealFloat a => LogAxisParams a -> AxisFn a
- autoSteps :: Int -> [Double] -> [Double]
- la_labelf :: forall a a. Lens (LinearAxisParams a) (LinearAxisParams a) ([a] -> [String]) ([a] -> [String])
- la_nLabels :: forall a. Lens' (LinearAxisParams a) Int
- la_nTicks :: forall a. Lens' (LinearAxisParams a) Int
- loga_labelf :: forall a a. Iso (LogAxisParams a) (LogAxisParams a) ([a] -> [String]) ([a] -> [String])

# Documentation

newtype Percent Source #

A wrapper class for doubles used to indicate they are to be plotted against a percentage axis.

Constructors

Percent |

Fields

- unPercent :: Double

#### Instances

Instances details

PlotValue Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toValue :: Percent -> Double Source # fromValue :: Double -> Percent Source # autoAxis :: AxisFn Percent Source #
Floating Percent Source # |

Instance details

Defined in Graphics.Rendering.Chart.Axis.Floating

Methods

pi :: Percent Source #

exp :: Percent -> Percent Source #

log :: Percent -> Percent Source #

sqrt :: Percent -> Percent Source #

(**) :: Percent -> Percent -> Percent Source #

logBase :: Percent -> Percent -> Percent Source #

sin :: Percent -> Percent Source #

cos :: Percent -> Percent Source #

tan :: Percent -> Percent Source #

asin :: Percent -> Percent Source #

acos :: Percent -> Percent Source #

atan :: Percent -> Percent Source #

sinh :: Percent -> Percent Source #

cosh :: Percent -> Percent Source #

tanh :: Percent -> Percent Source #

asinh :: Percent -> Percent Source #

acosh :: Percent -> Percent Source #

atanh :: Percent -> Percent Source #

log1p :: Percent -> Percent Source #

expm1 :: Percent -> Percent Source #

log1pexp :: Percent -> Percent Source #

log1mexp :: Percent -> Percent Source #

RealFloat Percent Source # |

Instance details

Defined in Graphics.Rendering.Chart.Axis.Floating

Methods

floatRadix :: Percent -> Integer Source #

floatDigits :: Percent -> Int Source #

floatRange :: Percent -> (Int, Int) Source #

decodeFloat :: Percent -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> Percent Source #

exponent :: Percent -> Int Source #

significand :: Percent -> Percent Source #

scaleFloat :: Int -> Percent -> Percent Source #

isNaN :: Percent -> Bool Source #

isInfinite :: Percent -> Bool Source #

isDenormalized :: Percent -> Bool Source #

isNegativeZero :: Percent -> Bool Source #

isIEEE :: Percent -> Bool Source #

atan2 :: Percent -> Percent -> Percent Source #

Num Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (+) :: Percent -> Percent -> Percent Source # (-) :: Percent -> Percent -> Percent Source # (*) :: Percent -> Percent -> Percent Source # negate :: Percent -> Percent Source # abs :: Percent -> Percent Source # signum :: Percent -> Percent Source # fromInteger :: Integer -> Percent Source #
Fractional Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (/) :: Percent -> Percent -> Percent Source # recip :: Percent -> Percent Source # fromRational :: Rational -> Percent Source #
Real Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toRational :: Percent -> Rational Source #
RealFrac Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods properFraction :: Integral b => Percent -> (b, Percent) Source # truncate :: Integral b => Percent -> b Source # round :: Integral b => Percent -> b Source # ceiling :: Integral b => Percent -> b Source # floor :: Integral b => Percent -> b Source #
Show Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods showsPrec :: Int -> Percent -> ShowS Source # show :: Percent -> String Source # showList :: [Percent] -> ShowS Source #
Eq Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (==) :: Percent -> Percent -> Bool Source # (/=) :: Percent -> Percent -> Bool Source #
Ord Percent Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods compare :: Percent -> Percent -> Ordering Source # (<) :: Percent -> Percent -> Bool Source # (<=) :: Percent -> Percent -> Bool Source # (>) :: Percent -> Percent -> Bool Source # (>=) :: Percent -> Percent -> Bool Source # max :: Percent -> Percent -> Percent Source # min :: Percent -> Percent -> Percent Source #

data LinearAxisParams a Source #

Constructors

LinearAxisParams |

Fields

- _la_labelf :: [a] -> [String]

  The function used to show the axes labels.

- _la_nLabels :: Int

  The target number of labels to be shown.

- _la_nTicks :: Int

  The target number of ticks to be shown.

#### Instances

Instances details

(Show a, RealFloat a) => Default (LinearAxisParams a) Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods def :: LinearAxisParams a Source #

newtype LogValue Source #

A wrapper class for doubles used to indicate they are to be plotted against a log axis.

Constructors

LogValue |

Fields

- unLogValue :: Double

#### Instances

Instances details

PlotValue LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toValue :: LogValue -> Double Source # fromValue :: Double -> LogValue Source # autoAxis :: AxisFn LogValue Source #
BarsPlotValue LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Plot.Bars Methods barsIsNull :: LogValue -> Bool Source # barsReference :: [LogValue] -> LogValue Source # barsAdd :: LogValue -> LogValue -> LogValue Source #
Floating LogValue Source # |

Instance details

Defined in Graphics.Rendering.Chart.Axis.Floating

Methods

pi :: LogValue Source #

exp :: LogValue -> LogValue Source #

log :: LogValue -> LogValue Source #

sqrt :: LogValue -> LogValue Source #

(**) :: LogValue -> LogValue -> LogValue Source #

logBase :: LogValue -> LogValue -> LogValue Source #

sin :: LogValue -> LogValue Source #

cos :: LogValue -> LogValue Source #

tan :: LogValue -> LogValue Source #

asin :: LogValue -> LogValue Source #

acos :: LogValue -> LogValue Source #

atan :: LogValue -> LogValue Source #

sinh :: LogValue -> LogValue Source #

cosh :: LogValue -> LogValue Source #

tanh :: LogValue -> LogValue Source #

asinh :: LogValue -> LogValue Source #

acosh :: LogValue -> LogValue Source #

atanh :: LogValue -> LogValue Source #

log1p :: LogValue -> LogValue Source #

expm1 :: LogValue -> LogValue Source #

log1pexp :: LogValue -> LogValue Source #

log1mexp :: LogValue -> LogValue Source #

RealFloat LogValue Source # |

Instance details

Defined in Graphics.Rendering.Chart.Axis.Floating

Methods

floatRadix :: LogValue -> Integer Source #

floatDigits :: LogValue -> Int Source #

floatRange :: LogValue -> (Int, Int) Source #

decodeFloat :: LogValue -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> LogValue Source #

exponent :: LogValue -> Int Source #

significand :: LogValue -> LogValue Source #

scaleFloat :: Int -> LogValue -> LogValue Source #

isNaN :: LogValue -> Bool Source #

isInfinite :: LogValue -> Bool Source #

isDenormalized :: LogValue -> Bool Source #

isNegativeZero :: LogValue -> Bool Source #

isIEEE :: LogValue -> Bool Source #

atan2 :: LogValue -> LogValue -> LogValue Source #

Num LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (+) :: LogValue -> LogValue -> LogValue Source # (-) :: LogValue -> LogValue -> LogValue Source # (*) :: LogValue -> LogValue -> LogValue Source # negate :: LogValue -> LogValue Source # abs :: LogValue -> LogValue Source # signum :: LogValue -> LogValue Source # fromInteger :: Integer -> LogValue Source #
Fractional LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (/) :: LogValue -> LogValue -> LogValue Source # recip :: LogValue -> LogValue Source # fromRational :: Rational -> LogValue Source #
Real LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toRational :: LogValue -> Rational Source #
RealFrac LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods properFraction :: Integral b => LogValue -> (b, LogValue) Source # truncate :: Integral b => LogValue -> b Source # round :: Integral b => LogValue -> b Source # ceiling :: Integral b => LogValue -> b Source # floor :: Integral b => LogValue -> b Source #
Show LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods showsPrec :: Int -> LogValue -> ShowS Source # show :: LogValue -> String Source # showList :: [LogValue] -> ShowS Source #
Eq LogValue Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (==) :: LogValue -> LogValue -> Bool Source # (/=) :: LogValue -> LogValue -> Bool Source #
Ord LogValue Source # |

Instance details

Defined in Graphics.Rendering.Chart.Axis.Floating

Methods

compare :: LogValue -> LogValue -> Ordering Source #

(<) :: LogValue -> LogValue -> Bool Source #

(<=) :: LogValue -> LogValue -> Bool Source #

(>) :: LogValue -> LogValue -> Bool Source #

(>=) :: LogValue -> LogValue -> Bool Source #

max :: LogValue -> LogValue -> LogValue Source #

min :: LogValue -> LogValue -> LogValue Source #

data LogAxisParams a Source #

Constructors

LogAxisParams |

Fields

- _loga_labelf :: [a] -> [String]

  The function used to show the axes labels.

#### Instances

Instances details

(Show a, RealFloat a) => Default (LogAxisParams a) Source # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods def :: LogAxisParams a Source #

scaledAxis :: RealFloat a => LinearAxisParams a -> (a, a) -> AxisFn a Source #

Generate a linear axis with the specified bounds

autoScaledAxis :: RealFloat a => LinearAxisParams a -> AxisFn a Source #

Generate a linear axis automatically, scaled appropriately for the input data.

autoScaledLogAxis :: RealFloat a => LogAxisParams a -> AxisFn a Source #

Generate a log axis automatically, scaled appropriately for the input data.

autoSteps :: Int -> [Double] -> [Double] Source #

Given a target number of values, and a list of input points, find evenly spaced values from the set {1*X, 2*X, 2.5*X, 5*X} (where X is some power of ten) that evenly cover the input points.

la_labelf :: forall a a. Lens (LinearAxisParams a) (LinearAxisParams a) ([a] -> [String]) ([a] -> [String]) Source #

la_nLabels :: forall a. Lens' (LinearAxisParams a) Int Source #

la_nTicks :: forall a. Lens' (LinearAxisParams a) Int Source #

loga_labelf :: forall a a. Iso (LogAxisParams a) (LogAxisParams a) ([a] -> [String]) ([a] -> [String]) Source #

# Orphan instances

PlotValue Double Source # |
Instance details Methods toValue :: Double -> Double Source # fromValue :: Double -> Double Source # autoAxis :: AxisFn Double Source #
PlotValue Float Source # |
Instance details Methods toValue :: Float -> Double Source # fromValue :: Double -> Float Source # autoAxis :: AxisFn Float Source #