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

Safe Haskell | None

Graphics.Rendering.Chart.Plot.Types

Description

Datatypes and functions common to the implementation of the various plot types.

Synopsis

- data Plot x y = Plot {
  - plot_render_ :: PointMapFn x y -> CRender ()
  - plot_legend_ :: [(String, Rect -> CRender ())]
  - plot_all_points_ :: ([x], [y])
  }
- joinPlot :: Plot x y -> Plot x y -> Plot x y
- class ToPlot a where
  - toPlot :: a x y -> Plot x y
- mapXY :: PointMapFn x y -> (x, y) -> Point
- plot_render :: forall x y. T (Plot x y) (PointMapFn x y -> CRender ())
- plot_legend :: forall x y. T (Plot x y) [(String, Rect -> CRender ())]
- plot_all_points :: forall x y. T (Plot x y) ([x], [y])

# Documentation

data Plot x y Source

Interface to control plotting on a 2D area.

Constructors

Plot |

Fields

plot_render_ :: PointMapFn x y -> CRender ()

  Given the mapping between model space coordinates and device coordinates, render this plot into a chart.

plot_legend_ :: [(String, Rect -> CRender ())]

  Details for how to show this plot in a legend. For each item the string is the text to show, and the function renders a graphical sample of the plot.

plot_all_points_ :: ([x], [y])

  All of the model space coordinates to be plotted. These are used to autoscale the axes where necessary.

joinPlot :: Plot x y -> Plot x y -> Plot x ySource

Join any two plots together (they will share a legend).

class ToPlot a where Source

A type class abstracting the conversion of a value to a Plot.

Methods

toPlot :: a x y -> Plot x ySource

Instances

ToPlot PlotLines |
ToPlot PlotPoints |
ToPlot PlotFillBetween |
ToPlot PlotErrBars |
ToPlot PlotCandle |
ToPlot PlotHidden |
ToPlot PlotAnnotation |
PlotValue z => ToPlot (AreaSpots z) |
(PlotValue z, PlotValue t, Show t) => ToPlot (AreaSpots4D z t) |

mapXY :: PointMapFn x y -> (x, y) -> Point Source

plot_render :: forall x y. T (Plot x y) (PointMapFn x y -> CRender ())Source

plot_legend :: forall x y. T (Plot x y) [(String, Rect -> CRender ())]Source

plot_all_points :: forall x y. T (Plot x y) ([x], [y])Source