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

Safe HaskellNone



Bar Charts



data PlotBars x y Source

Value describing how to plot a set of bars. Note that the input data is typed [(x,[y])], ie for each x value we plot several y values. Typically the size of each [y] list would be the same.




plot_bars_style_ :: PlotBarsStyle

This value specifies whether each value from [y] should be shown beside or above the previous value.

plot_bars_item_styles_ :: [(CairoFillStyle, Maybe CairoLineStyle)]

The style in which to draw each element of [y]. A fill style is required, and if a linestyle is given, each bar will be outlined.

plot_bars_titles_ :: [String]

The title of each element of [y]. These will be shown in the legend.

plot_bars_spacing_ :: PlotBarsSpacing

This value controls how the widths of the bars are calculated. Either the widths of the bars, or the gaps between them can be fixed.

plot_bars_alignment_ :: PlotBarsAlignment

This value controls how bars for a fixed x are aligned with respect to the device coordinate corresponding to x.

plot_bars_reference_ :: y

The starting level for the chart (normally 0).

plot_bars_singleton_width_ :: Double
plot_bars_values_ :: [(x, [y])]

The actual points to be plotted.

data PlotBarsStyle Source



Bars for a fixed x are stacked vertically on top of each other.


Bars for a fixed x are put horizontally beside each other.


data PlotBarsSpacing Source


BarsFixWidth Double

All bars have the same width in pixels.

BarsFixGap Double Double

(BarsFixGap g mw) means make the gaps between the bars equal to g, but with a minimum bar width of mw

data PlotBarsAlignment Source

How bars for a given (x,[y]) are aligned with respect to screen coordinate corresponding to x (deviceX).



The left edge of bars is at deviceX


The right edge of bars is at deviceX


Bars are centered around deviceX

plot_bars_titles :: forall x y. T (PlotBars x y) [String]Source

plot_bars_reference :: forall x y. T (PlotBars x y) ySource

plot_bars_values :: forall x y. T (PlotBars x y) [(x, [y])]Source