chart-unit-0.5.4: Native haskell charts.

Safe HaskellNone
LanguageHaskell2010

Chart.Text

Description

textual chart elements

Synopsis

Documentation

text_ :: TextOptions -> Text -> Chart b Source #

Create a textual chart element

let text_Example = text_ def "Welcome to chart-unit!"

texts :: R2 r => TextOptions -> [Text] -> [r Double] -> Chart b Source #

Creatye positioned text from a list

let ts = map (Text.singleton) ['a'..'z']
texts def ts [Pair (0.05*x) 0 |x <- [0..5]]

textChart :: Traversable f => [TextOptions] -> Aspect -> Rect Double -> [f (Text, Pair Double)] -> Chart b Source #

A chart of text

textChart_ :: [TextOptions] -> Aspect -> [[(Text, Pair Double)]] -> Chart b Source #

A chart of text scaled to its own range

import qualified Data.Text as Text
let ps = [Pair (sin (x*0.1)) x | x<-[0..25]]
textChart_ (repeat $ def {textSize=0.33}) widescreen [zip ts ps]

data LabelOptions Source #

A label is a text element attached to a chart element

Constructors

LabelOptions 

Fields

labelled :: LabelOptions -> Text -> Chart b -> Chart b Source #

Label a chart element with some text

let lopts = def {textAlignH = AlignLeft, textRotation=45}
labelled (LabelOptions lopts (Pair 1 1) 0.05) "a label" (glyph_ def)