Safe Haskell | None |
---|---|
Language | Haskell2010 |
bar charts
Synopsis
- data BarOptions = BarOptions {}
- defaultBarOptions :: BarOptions
- data BarData = BarData {
- barData :: [[Double]]
- barRowLabels :: Maybe [Text]
- barColumnLabels :: Maybe [Text]
- barDataLowerUpper :: Bool -> [[Double]] -> [[(Double, Double)]]
- barRange :: [[Double]] -> Rect Double
- bars :: BarOptions -> BarData -> [Chart Double]
- barChart :: BarOptions -> BarData -> (HudOptions, [Chart Double])
Documentation
data BarOptions Source #
the usual bar chart eye-candy
BarOptions | |
|
Instances
defaultBarOptions :: BarOptions Source #
The official bar options.
imagine a dataframe you get in other languages:
- definietly some [[Double]]
- maybe some row names
- maybe some column names
BarData | |
|
Instances
Eq BarData Source # | |
Show BarData Source # | |
Generic BarData Source # | |
type Rep BarData Source # | |
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.