Graphics.Rendering.Chart.Legend

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

Copyright | (c) Tim Docker 2006 2014
License | BSD-style (see chart/COPYRIGHT)
Safe Haskell | None
Language | Haskell98

Graphics.Rendering.Chart.Legend

Description

Types and functions for handling the legend(s) on a chart. A legend is an area on the chart used to label the plotted values.

Synopsis

- data Legend x y = Legend LegendStyle [(String, Rect -> BackendProgram ())]
- data LegendStyle = LegendStyle {
  - _legend_label_style :: FontStyle
  - _legend_margin :: Double
  - _legend_plot_size :: Double
  - _legend_orientation :: LegendOrientation
  - _legend_position :: LegendPosition
  }
- data LegendOrientation
  - = LORows Int
  - | LOCols Int
- data LegendPosition
  - = LegendAbove
  - | LegendBelow
  - | LegendRight
  - | LegendLeft
- legendToRenderable :: Legend x y -> Renderable String
- legend_label_style :: Lens' LegendStyle FontStyle
- legend_margin :: Lens' LegendStyle Double
- legend_plot_size :: Lens' LegendStyle Double
- legend_orientation :: Lens' LegendStyle LegendOrientation
- legend_position :: Lens' LegendStyle LegendPosition

# Documentation

data Legend x y #

Constructors

Legend LegendStyle [(String, Rect -> BackendProgram ())] |

#### Instances

Instances details

ToRenderable (Legend x y) # |
Instance details Defined in Graphics.Rendering.Chart.Legend Methods toRenderable :: Legend x y -> Renderable () #

data LegendStyle #

Constructors

LegendStyle |
Fields _legend_label_style :: FontStyle _legend_margin :: Double _legend_plot_size :: Double _legend_orientation :: LegendOrientation _legend_position :: LegendPosition

#### Instances

Instances details

Default LegendStyle # |
Instance details Defined in Graphics.Rendering.Chart.Legend Methods def :: LegendStyle #

data LegendOrientation #

Legends can be constructed in two orientations: in rows (where we specify the maximum number of columns), and in columns (where we specify the maximum number of rows)

Constructors

LORows Int |
LOCols Int |

data LegendPosition #

Defines the position of the legend, relative to the plot.

Constructors

LegendAbove |
LegendBelow |
LegendRight |
LegendLeft |

legendToRenderable :: Legend x y -> Renderable String #

legend_label_style :: Lens' LegendStyle FontStyle #

legend_margin :: Lens' LegendStyle Double #

legend_plot_size :: Lens' LegendStyle Double #

legend_orientation :: Lens' LegendStyle LegendOrientation #

legend_position :: Lens' LegendStyle LegendPosition #