chart-svg-0.1.3: Charts in SVG

Safe HaskellNone
LanguageHaskell2010

Chart.Bar

Description

bar charts

Synopsis

Documentation

data BarOptions Source #

the usual bar chart eye-candy

Instances
Eq BarOptions Source # 
Instance details

Defined in Chart.Bar

Show BarOptions Source # 
Instance details

Defined in Chart.Bar

Generic BarOptions Source # 
Instance details

Defined in Chart.Bar

Associated Types

type Rep BarOptions :: Type -> Type #

type Rep BarOptions Source # 
Instance details

Defined in Chart.Bar

defaultBarOptions :: BarOptions Source #

The official bar options.

data BarData Source #

imagine a dataframe you get in other languages:

  • definietly some [[Double]]
  • maybe some row names
  • maybe some column names

Constructors

BarData 
Instances
Eq BarData Source # 
Instance details

Defined in Chart.Bar

Methods

(==) :: BarData -> BarData -> Bool #

(/=) :: BarData -> BarData -> Bool #

Show BarData Source # 
Instance details

Defined in Chart.Bar

Generic BarData Source # 
Instance details

Defined in Chart.Bar

Associated Types

type Rep BarData :: Type -> Type #

Methods

from :: BarData -> Rep BarData x #

to :: Rep BarData x -> BarData #

type Rep BarData Source # 
Instance details

Defined in Chart.Bar

type Rep BarData = D1 (MetaData "BarData" "Chart.Bar" "chart-svg-0.1.3-Z7gbzoFQmt7GiUmEthHG3" False) (C1 (MetaCons "BarData" PrefixI True) (S1 (MetaSel (Just "barData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [[Double]]) :*: (S1 (MetaSel (Just "barRowLabels") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [Text])) :*: S1 (MetaSel (Just "barColumnLabels") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [Text])))))

barDataLowerUpper :: Bool -> [[Double]] -> [[(Double, Double)]] Source #

convert data to a range assuming a zero bound a very common but implicit assumption in a lot of bar charts

>>> barDataLowerUpper False [[1,2],[2,3]]
[[(0.0,1.0),(0.0,2.0)],[(0.0,2.0),(0.0,3.0)]]

barRange :: [[Double]] -> Rect Double Source #

calculate the Rect range of a bar data set.

>>> barRange [[1,2],[2,3]]
Rect 0.0 2.0 0.0 3.0

bars :: BarOptions -> BarData -> [Chart Double] Source #

A bar chart without hud trimmings.

>>> bars defaultBarOptions (BarData [[1,2],[2,3]] Nothing Nothing)
[Chart {annotation = RectA (RectStyle {borderSize = 2.0e-3, borderColor = RGBA 0.65 0.81 0.89 1.00, color = RGBA 0.65 0.81 0.89 1.00}), xys = [RectXY Rect 5.0e-2 0.45 0.0 1.0,RectXY Rect 1.05 1.4500000000000002 0.0 2.0]},Chart {annotation = RectA (RectStyle {borderSize = 2.0e-3, borderColor = RGBA 0.12 0.47 0.71 1.00, color = RGBA 0.12 0.47 0.71 1.00}), xys = [RectXY Rect 0.45 0.8500000000000001 0.0 2.0,RectXY Rect 1.4500000000000002 1.85 0.0 3.0]},Chart {annotation = BlankA, xys = [RectXY Rect -5.0e-2 1.9500000000000002 0.0 3.0]}]

barChart :: BarOptions -> BarData -> (HudOptions, [Chart Double]) Source #

A bar chart with hud trimmings.

By convention only, the first axis (if any) is the bar axis.