Graphics.Rendering.Chart.Axis
Description
Code to calculate and render axes.
Note that template haskell is used to derive accessor functions
(see Data.Accessor
) for each field of the following data types:
These accessors are not shown in this API documentation. They have the same name as the field, but with the trailing underscore dropped. Hence for data field f_::F in type D, they have type
f :: Data.Accessor.Accessor D F
- data AxisData x = AxisData {
- axis_viewport_ :: Range -> x -> Double
- axis_ticks_ :: [(x, Double)]
- axis_labels_ :: [(x, String)]
- axis_grid_ :: [x]
- data AxisT x = AxisT RectEdge AxisStyle Bool (AxisData x)
- data LinearAxisParams = LinearAxisParams {
- la_labelf_ :: Double -> String
- la_nLabels_ :: Int
- la_nTicks_ :: Int
- data LogAxisParams = LogAxisParams {
- loga_labelf_ :: LogValue -> String
- data AxisStyle = AxisStyle {}
- class Ord a => PlotValue a where
- newtype LogValue = LogValue Double
- type AxisFn x = [x] -> AxisData x
- defaultAxisLineStyle :: CairoLineStyle
- defaultLinearAxis :: LinearAxisParams
- defaultLogAxis :: LogAxisParams
- defaultAxisStyle :: AxisStyle
- autoScaledAxis :: LinearAxisParams -> AxisFn Double
- autoScaledLogAxis :: LogAxisParams -> AxisFn LogValue
- timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> AxisFn LocalTime
- autoTimeAxis :: AxisFn LocalTime
- days :: TimeSeq
- months :: TimeSeq
- years :: TimeSeq
- axisToRenderable :: AxisT x -> Renderable x
- renderAxisGrid :: RectSize -> AxisT z -> CRender ()
- axisOverhang :: Ord x => AxisT x -> CRender (Double, Double)
- axisGridNone :: AxisData x -> AxisData x
- axisGridAtTicks :: AxisData x -> AxisData x
- axisGridAtLabels :: AxisData x -> AxisData x
- axis_viewport :: forall x[afhq]. T (AxisData x[afhq]) (Range -> x[afhq] -> Double)
- axis_ticks :: forall x[afhq]. T (AxisData x[afhq]) ([] ((,) x[afhq] Double))
- axis_labels :: forall x[afhq]. T (AxisData x[afhq]) ([] ((,) x[afhq] String))
- axis_grid :: forall x[afhq]. T (AxisData x[afhq]) ([] x[afhq])
- axis_line_style :: T AxisStyle CairoLineStyle
- axis_label_style :: T AxisStyle CairoFontStyle
- axis_grid_style :: T AxisStyle CairoLineStyle
- axis_label_gap :: T AxisStyle Double
- la_labelf :: T LinearAxisParams (Double -> String)
- la_nLabels :: T LinearAxisParams Int
- la_nTicks :: T LinearAxisParams Int
- loga_labelf :: T LogAxisParams (LogValue -> String)
Documentation
The basic data associated with an axis showing values of type x
Constructors
AxisData | |
Fields
|
Collect the information we need to render an axis. The bool is true if the axis direction is reversed
Instances
ToRenderable (AxisT x) |
data LinearAxisParams Source
Constructors
LinearAxisParams | |
Fields
|
data LogAxisParams Source
Constructors
LogAxisParams | |
Fields
|
Control values for how an axis gets displayed
Constructors
AxisStyle | |
Fields
|
type AxisFn x = [x] -> AxisData xSource
A function to generate the axis data given the data values to be plotted against it.
autoScaledAxis :: LinearAxisParams -> AxisFn DoubleSource
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.
autoScaledLogAxis :: LogAxisParams -> AxisFn LogValueSource
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.
timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> AxisFn LocalTimeSource
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 :: AxisFn LocalTimeSource
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
axisToRenderable :: AxisT x -> Renderable xSource
axisOverhang :: Ord x => AxisT x -> CRender (Double, Double)Source
Calculate the amount by which the labels extend beyond the ends of the axis
axisGridNone :: AxisData x -> AxisData xSource
axisGridAtTicks :: AxisData x -> AxisData xSource
axisGridAtLabels :: AxisData x -> AxisData xSource
loga_labelf :: T LogAxisParams (LogValue -> String)Source