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

Safe HaskellNone

Graphics.Rendering.Chart.Types

Description

 

Synopsis

Documentation

data Point Source

A point in two dimensions

Constructors

Point 

Fields

p_x :: Double
 
p_y :: Double
 

Instances

data Vector Source

Constructors

Vector 

Fields

v_x :: Double
 
v_y :: Double
 

Instances

data Color Source

Constructors

Color 

Fields

c_r :: Double
 
c_g :: Double
 
c_b :: Double
 

vscale :: Double -> Vector -> VectorSource

scale a vector by a constant

pvadd :: Point -> Vector -> PointSource

add a point and a vector

pvsub :: Point -> Vector -> PointSource

subtract a vector from a point

psub :: Point -> Point -> VectorSource

subtract two points

type PointMapFn = Point -> PointSource

a function mapping between points

data Rect Source

A rectangle is defined by two points

Constructors

Rect Point Point 

Instances

mkrect :: Point -> Point -> Point -> Point -> RectSource

Create a rectangle based upon the coordinates of 4 points

vmap :: Range -> Range -> Double -> DoubleSource

A linear mapping of points in one range to another

data CEnv Source

The environment present in the CRender Monad.

Constructors

CEnv 

Fields

cenv_point_alignfn :: Point -> Point

A transform applied immediately prior to values being displayed in device coordinates

When device coordinates correspond to pixels, a cleaner image is created if this transform rounds to the nearest pixel. With higher-resolution output, this transform can just be the identity function.

newtype CairoPointStyle Source

Abstract data type for the style of a plotted point

The contained Cairo action draws a point in the desired style, at the supplied device coordinates.

Constructors

CairoPointStyle (Point -> CRender ()) 

newtype CairoLineStyle Source

Abstract data type for the style of a line

The contained Cairo action sets the required line in the Cairo rendering state.

Constructors

CairoLineStyle (CRender ()) 

newtype CairoFillStyle Source

Abstract data type for a fill style

The contained Cairo action sets the required fill style in the Cairo rendering state.

Constructors

CairoFillStyle (CRender ()) 

newtype CairoFontStyle Source

Abstract data type for a font.

The contained Cairo action sets the required font in the Cairo rendering state.

Constructors

CairoFontStyle (CRender ()) 

strokeLines :: [Point] -> CRender ()Source

stroke the lines between successive points

rectPath :: Rect -> CRender ()Source

make a path from a rectable

drawText :: HTextAnchor -> VTextAnchor -> Point -> String -> CRender ()Source

Function to draw a textual label anchored by one of it's corners or edges.

preserveCState :: CRender a -> CRender aSource

Execute a rendering action in a saved context (ie bracketed between C.save and C.restore)

filledCirclesSource

Arguments

:: Double

radius of circle

-> Color

colour

-> CairoPointStyle 

hollowCirclesSource

Arguments

:: Double

radius of circle

-> Double

thickness of line

-> Color 
-> CairoPointStyle 

hollowPolygonSource

Arguments

:: Double

radius of circle

-> Double

thickness of line

-> Int

Number of vertices

-> Bool

Is right-side-up?

-> Color 
-> CairoPointStyle 

filledPolygonSource

Arguments

:: Double

radius of circle

-> Int

Number of vertices

-> Bool

Is right-side-up?

-> Color 
-> CairoPointStyle 

plussesSource

Arguments

:: Double

radius of circle

-> Double

thickness of line

-> Color 
-> CairoPointStyle 

exesSource

Arguments

:: Double

radius of circle

-> Double

thickness of line

-> Color 
-> CairoPointStyle 

starsSource

Arguments

:: Double

radius of circle

-> Double

thickness of line

-> Color 
-> CairoPointStyle 

solidLineSource

Arguments

:: Double

width of line

-> Color 
-> CairoLineStyle 

dashedLineSource

Arguments

:: Double

width of line

-> [Double]

the dash pattern in device coordinates

-> Color 
-> CairoLineStyle 

fontStyleSource

Arguments

:: String

the font name

-> Double

the font size

-> FontSlant

the font slant

-> FontWeight

the font weight

-> CairoFontStyle