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

Safe Haskell | None

Graphics.Rendering.Chart.Axis.Floating

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 Double
- data LogAxisParams a = LogAxisParams {
  - loga_labelf_ :: a -> String
  }
- defaultLinearAxis :: (Show a, RealFloat a) => LinearAxisParams a
- defaultLogAxis :: (Show a, RealFloat a) => LogAxisParams a
- 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. T (LinearAxisParams a) (a -> String)
- la_nLabels :: forall a. T (LinearAxisParams a) Int
- la_nTicks :: forall a. T (LinearAxisParams a) Int
- loga_labelf :: forall a. T (LogAxisParams a) (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

Eq Percent |
Floating Percent |
Fractional Percent |
Num Percent |
Ord Percent |
Real Percent |
RealFloat Percent |
RealFrac Percent |
Show Percent |
PlotValue Percent |

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.

newtype LogValue Source

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

Constructors

LogValue Double |

Instances

Eq LogValue |
Floating LogValue |
Fractional LogValue |
Num LogValue |
Ord LogValue |
Real LogValue |
RealFloat LogValue |
RealFrac LogValue |
Show LogValue |
PlotValue LogValue |

data LogAxisParams a Source

Constructors

LogAxisParams |

Fields

loga_labelf_ :: a -> String

  The function used to show the axes labels.

defaultLinearAxis :: (Show a, RealFloat a) => LinearAxisParams aSource

defaultLogAxis :: (Show a, RealFloat a) => LogAxisParams aSource

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

Generate a linear axis with the specified bounds

autoScaledAxis :: RealFloat a => LinearAxisParams a -> AxisFn aSource

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

autoScaledLogAxis :: RealFloat a => LogAxisParams a -> AxisFn aSource

Generate a log axis automatically, scaled appropriate 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. T (LinearAxisParams a) (a -> String)Source

la_nLabels :: forall a. T (LinearAxisParams a) Int Source

la_nTicks :: forall a. T (LinearAxisParams a) Int Source

loga_labelf :: forall a. T (LogAxisParams a) (a -> String)Source