-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for generating 2D Charts and Plots -- -- A library for generating 2D Charts and Plots, based upon the cairo -- graphics library. @package Chart @version 0.9 -- | This module contains basic types and functions used for drawing. -- -- Note that template haskell is used to derive accessor functions (see -- Data.Accessor) for each field of the following data types: -- -- -- -- These accessors are not shown in this API documentation. They have the -- same name as the field, but with the trailing underscore dropped. -- Hence for data field f_::F in type D, they have type -- --
--   f :: Data.Accessor.Accessor D F
--   
module Graphics.Rendering.Chart.Types -- | A rectangle is defined by two points data Rect Rect :: Point -> Point -> Rect -- | A point in two dimensions data Point Point :: Double -> Double -> Point p_x :: Point -> Double p_y :: Point -> Double data Vector Vector :: Double -> Double -> Vector v_x :: Vector -> Double v_y :: Vector -> Double type RectSize = (Double, Double) type Range = (Double, Double) -- | Create a rectangle based upon the coordinates of 4 points mkrect :: Point -> Point -> Point -> Point -> Rect -- | add a point and a vector pvadd :: Point -> Vector -> Point -- | subtract a vector from a point pvsub :: Point -> Vector -> Point -- | subtract two points psub :: Point -> Point -> Vector -- | scale a vector by a constant vscale :: Double -> Vector -> Vector -- | Test if a point is within a rectangle within :: Point -> Rect -> Bool data RectEdge E_Top :: RectEdge E_Bottom :: RectEdge E_Left :: RectEdge E_Right :: RectEdge -- | a function mapping between points type PointMapFn x y = (x, y) -> Point -- | Execute a rendering action in a saved context (ie bracketed between -- C.save and C.restore) preserveCState :: CRender a -> CRender a setClipRegion :: Point -> Point -> CRender () -- | stroke the lines between successive points strokeLines :: [Point] -> CRender () moveTo :: Point -> CRender () lineTo :: Point -> CRender () -- | make a path from a rectable rectPath :: Rect -> CRender () isValidNumber :: (RealFloat a) => a -> Bool maybeM :: (Monad m) => a -> (a1 -> m a) -> Maybe a1 -> m a black :: Color grey8 :: Color white :: Color red :: Color green :: Color blue :: Color defaultColorSeq :: [Color] data Color Color :: Double -> Double -> Double -> Color c_r :: Color -> Double c_g :: Color -> Double c_b :: Color -> Double setSourceColor :: Color -> Render () -- | Data type for the style of a line data CairoLineStyle CairoLineStyle :: Double -> Color -> [Double] -> LineCap -> LineJoin -> CairoLineStyle line_width_ :: CairoLineStyle -> Double line_color_ :: CairoLineStyle -> Color line_dashes_ :: CairoLineStyle -> [Double] line_cap_ :: CairoLineStyle -> LineCap line_join_ :: CairoLineStyle -> LineJoin solidLine :: Double -> Color -> CairoLineStyle dashedLine :: Double -> [Double] -> Color -> CairoLineStyle setLineStyle :: CairoLineStyle -> CRender () -- | Abstract data type for a fill style -- -- The contained Cairo action sets the required fill style in the Cairo -- rendering state. newtype CairoFillStyle CairoFillStyle :: (CRender ()) -> CairoFillStyle defaultPointStyle :: CairoPointStyle solidFillStyle :: Color -> CairoFillStyle setFillStyle :: CairoFillStyle -> CRender () -- | Data type for a font data CairoFontStyle CairoFontStyle :: String -> Double -> FontSlant -> FontWeight -> Color -> CairoFontStyle font_name_ :: CairoFontStyle -> String font_size_ :: CairoFontStyle -> Double font_slant_ :: CairoFontStyle -> FontSlant font_weight_ :: CairoFontStyle -> FontWeight font_color_ :: CairoFontStyle -> Color defaultFontStyle :: CairoFontStyle setFontStyle :: CairoFontStyle -> CRender () -- | Abstract data type for the style of a plotted point -- -- The contained Cairo action draws a point in the desired style, at the -- supplied device coordinates. newtype CairoPointStyle CairoPointStyle :: (Point -> CRender ()) -> CairoPointStyle filledPolygon :: Double -> Int -> Bool -> Color -> CairoPointStyle hollowPolygon :: Double -> Double -> Int -> Bool -> Color -> CairoPointStyle filledCircles :: Double -> Color -> CairoPointStyle hollowCircles :: Double -> Double -> Color -> CairoPointStyle plusses :: Double -> Double -> Color -> CairoPointStyle exes :: Double -> Double -> Color -> CairoPointStyle stars :: Double -> Double -> Color -> CairoPointStyle data HTextAnchor HTA_Left :: HTextAnchor HTA_Centre :: HTextAnchor HTA_Right :: HTextAnchor data VTextAnchor VTA_Top :: VTextAnchor VTA_Centre :: VTextAnchor VTA_Bottom :: VTextAnchor VTA_BaseLine :: VTextAnchor -- | Function to draw a textual label anchored by one of it's corners or -- edges. drawText :: HTextAnchor -> VTextAnchor -> Point -> String -> CRender () -- | Return the bounding rectancgle for a text string rendered in the -- current context. textSize :: String -> CRender RectSize -- | The reader monad containing context information to control the -- rendering process. newtype CRender a DR :: (ReaderT CEnv Render a) -> CRender a -- | The environment present in the CRender Monad. data CEnv CEnv :: (Point -> Point) -> CEnv -- | A transform applied immediately prior to values being displayed in -- device coordinates -- -- When device coordinates correspond to pixels, a cleaner image is -- created if this transform rounds to the nearest pixel. With -- higher-resolution output, this transform can just be the identity -- function. cenv_point_alignfn :: CEnv -> Point -> Point runCRender :: CRender a -> CEnv -> Render a c :: Render a -> CRender a line_width :: T CairoLineStyle Double line_color :: T CairoLineStyle Color line_dashes :: T CairoLineStyle ([] Double) line_cap :: T CairoLineStyle LineCap line_join :: T CairoLineStyle LineJoin font_name :: T CairoFontStyle String font_size :: T CairoFontStyle Double font_slant :: T CairoFontStyle FontSlant font_weight :: T CairoFontStyle FontWeight font_color :: T CairoFontStyle Color instance Functor CRender instance Monad CRender instance MonadReader CEnv CRender instance Show Rect instance Show Vector instance Show Point -- | This module contains the definition of the Renderable type, -- which is a composable drawing element, along with assorted functions -- to them. module Graphics.Rendering.Chart.Renderable -- | A Renderable is a record of functions required to layout a graphic -- element. data Renderable a Renderable :: CRender RectSize -> (RectSize -> CRender (PickFn a)) -> Renderable a -- | a Cairo action to calculate a minimum size, minsize :: Renderable a -> CRender RectSize -- | a Cairo action for drawing it within a rectangle. The rectangle is -- from the origin to the given point. -- -- The resulting pick function maps a point in the image to a -- value. render :: Renderable a -> RectSize -> CRender (PickFn a) -- | A type class abtracting the conversion of a value to a Renderable. class ToRenderable a toRenderable :: (ToRenderable a) => a -> Renderable () -- | A function that maps a point in device coordinates to some value. -- -- Perhaps it might be generalised from Maybe a to (MonadPlus m ) => m -- a in the future. type PickFn a = Point -> (Maybe a) -- | Output the given renderable to a PNG file of the specifed size (in -- pixels), to the specified file. renderableToPNGFile :: Renderable a -> Int -> Int -> FilePath -> IO () -- | Output the given renderable to a PDF file of the specifed size (in -- points), to the specified file. renderableToPDFFile :: Renderable a -> Int -> Int -> FilePath -> IO () -- | Output the given renderable to a postscript file of the specifed size -- (in points), to the specified file. renderableToPSFile :: Renderable a -> Int -> Int -> FilePath -> IO () -- | Output the given renderable to an SVG file of the specifed size (in -- points), to the specified file. renderableToSVGFile :: Renderable a -> Int -> Int -> FilePath -> IO () vectorEnv :: CEnv bitmapEnv :: CEnv -- | Overlay a renderable over a solid background fill. fillBackground :: CairoFillStyle -> Renderable a -> Renderable a -- | Add some spacing at the edges of a renderable. addMargins :: (Double, Double, Double, Double) -> Renderable a -> Renderable a emptyRenderable :: Renderable a -- | Helper function for using a renderable, when we generate it in the -- CRender monad. embedRenderable :: CRender (Renderable a) -> Renderable a -- | Construct a renderable from a text string, aligned with the axes label :: CairoFontStyle -> HTextAnchor -> VTextAnchor -> String -> Renderable a -- | Construct a renderable from a text string, rotated wrt to axes. The -- angle of rotation is in degrees. rlabel :: CairoFontStyle -> HTextAnchor -> VTextAnchor -> Double -> String -> Renderable a -- | Create a blank renderable with a specified minimum size spacer :: RectSize -> Renderable a -- | Create a blank renderable with a minimum size the same as some other -- renderable. spacer1 :: Renderable a -> Renderable b -- | Replace the pick function of a renderable with another setPickFn :: PickFn b -> Renderable a -> Renderable b -- | Map a function over result of a renderables pickfunction. mapPickFn :: (a -> b) -> Renderable a -> Renderable b nullPickFn :: PickFn a rect_minsize :: Accessor Rectangle RectSize rect_fillStyle :: Accessor Rectangle (Maybe CairoFillStyle) rect_lineStyle :: Accessor Rectangle (Maybe CairoLineStyle) rect_cornerStyle :: Accessor Rectangle RectCornerStyle instance ToRenderable Rectangle -- | Code to calculate and render axes. -- -- Note that template haskell is used to derive accessor functions (see -- Data.Accessor) for each field of the following data types: -- -- -- -- These accessors are not shown in this API documentation. They have the -- same name as the field, but with the trailing underscore dropped. -- Hence for data field f_::F in type D, they have type -- --
--   f :: Data.Accessor.Accessor D F
--   
module Graphics.Rendering.Chart.Axis -- | The basic data associated with an axis showing values of type x data AxisData x AxisData :: (Range -> x -> Double) -> [(x, Double)] -> [(x, String)] -> [x] -> AxisData x -- | The axis_viewport_ function maps values into device cordinates. axis_viewport_ :: AxisData x -> Range -> x -> Double -- | The tick marks on the axis as pairs. The first element is the position -- on the axis (in viewport units) and the second element is the length -- of the tick in output coordinates. The tick starts on the axis, and -- positive number are drawn towards the plot area. axis_ticks_ :: AxisData x -> [(x, Double)] -- | The labels on an axis as pairs. The first element is the position on -- the axis (in viewport units) and the second is the label text string. axis_labels_ :: AxisData x -> [(x, String)] -- | The positions on the axis (in viewport units) where we want to show -- grid lines. axis_grid_ :: AxisData x -> [x] -- | Collect the information we need to render an axis. The bool is true if -- the axis direction is reversed data AxisT x AxisT :: RectEdge -> AxisStyle -> Bool -> (AxisData x) -> AxisT x data LinearAxisParams LinearAxisParams :: (Double -> String) -> Int -> Int -> LinearAxisParams -- | The function used to show the axes labels la_labelf_ :: LinearAxisParams -> Double -> String -- | The target number of labels to be shown la_nLabels_ :: LinearAxisParams -> Int -- | The target number of ticks to be shown la_nTicks_ :: LinearAxisParams -> Int data LogAxisParams LogAxisParams :: (LogValue -> String) -> LogAxisParams -- | The function used to show the axes labels loga_labelf_ :: LogAxisParams -> LogValue -> String -- | Control values for how an axis gets displayed data AxisStyle AxisStyle :: CairoLineStyle -> CairoFontStyle -> CairoLineStyle -> Double -> AxisStyle axis_line_style_ :: AxisStyle -> CairoLineStyle axis_label_style_ :: AxisStyle -> CairoFontStyle axis_grid_style_ :: AxisStyle -> CairoLineStyle -- | How far the labels are to be drawn from the axis. axis_label_gap_ :: AxisStyle -> Double class (Ord a) => PlotValue a toValue :: (PlotValue a) => a -> Double autoAxis :: (PlotValue a) => AxisFn a newtype LogValue LogValue :: Double -> LogValue -- | A function to generate the axis data given the data values to be -- plotted against it. type AxisFn x = [x] -> AxisData x defaultAxisLineStyle :: CairoLineStyle defaultLinearAxis :: LinearAxisParams defaultLogAxis :: LogAxisParams defaultAxisStyle :: AxisStyle -- | Generate a linear axis automatically. The supplied axis is used as a -- template, with the viewport, ticks, labels and grid set appropriately -- for the data displayed against that axies. The resulting axis will -- only show a grid if the template has some grid values. autoScaledAxis :: LinearAxisParams -> AxisFn Double -- | Generate a log axis automatically. The supplied axis is used as a -- template, with the viewport, ticks, labels and grid set appropriately -- for the data displayed against that axies. The resulting axis will -- only show a grid if the template has some grid values. autoScaledLogAxis :: LogAxisParams -> AxisFn LogValue -- | Create an AxisFn to for a time axis. The first TimeSeq -- sets the minor ticks, and the ultimate range will aligned to it's -- elements. The second TimeSeq sets the labels and grid. The -- TimeLabelFn is used to format LocalTimes for labels. The values -- to be plotted against this axis can be created with -- doubleFromLocalTime timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> AxisFn LocalTime -- | Automatically choose a suitable time axis, based upon the time range -- of data. The values to be plotted against this axis can be created -- with doubleFromLocalTime autoTimeAxis :: AxisFn LocalTime -- | A TimeSeq for calendar days days :: TimeSeq -- | A TimeSeq for calendar months months :: TimeSeq -- | A TimeSeq for calendar years years :: TimeSeq axisToRenderable :: AxisT x -> Renderable x renderAxisGrid :: RectSize -> AxisT z -> CRender () -- | Calculate the amount by which the labels extend beyond the ends of the -- axis axisOverhang :: (Ord x) => AxisT x -> CRender (Double, Double) axisGridNone :: AxisData x -> AxisData x axisGridAtTicks :: AxisData x -> AxisData x axisGridAtLabels :: AxisData x -> AxisData x axis_viewport :: T (AxisData x[afhq]) (Range -> x[afhq] -> Double) axis_ticks :: T (AxisData x[afhq]) ([] ((,) x[afhq] Double)) axis_labels :: T (AxisData x[afhq]) ([] ((,) x[afhq] String)) axis_grid :: T (AxisData x[afhq]) ([] x[afhq]) axis_line_style :: T AxisStyle CairoLineStyle axis_label_style :: T AxisStyle CairoFontStyle axis_grid_style :: T AxisStyle CairoLineStyle axis_label_gap :: T AxisStyle Double la_labelf :: T LinearAxisParams (Double -> String) la_nLabels :: T LinearAxisParams Int la_nTicks :: T LinearAxisParams Int loga_labelf :: T LogAxisParams (LogValue -> String) instance Eq LogValue instance Ord LogValue instance PlotValue LocalTime instance PlotValue LogValue instance Show LogValue instance PlotValue Double instance ToRenderable (AxisT x) -- | Definitions of various types of Plots we can put on a 2D Chart. -- -- Note that template haskell is used to derive accessor functions (see -- Data.Accessor) for each field of the following data types: -- -- -- -- These accessors are not shown in this API documentation. They have the -- same name as the field, but with the trailing underscore dropped. -- Hence for data field f_::F in type D, they have type -- --
--   f :: Data.Accessor.Accessor D F
--   
module Graphics.Rendering.Chart.Plot -- | Interface to control plotting on a 2D area. data Plot x y Plot :: (PointMapFn x y -> CRender ()) -> (Rect -> CRender ()) -> [(x, y)] -> Plot x y -- | Given the mapping between model space coordinates and device -- coordinates, render this plot into a chart. plot_render_ :: Plot x y -> PointMapFn x y -> CRender () -- | Render a small sample of this plot into the given rectangle. This is -- for used to generate a the legend a chart. plot_render_legend_ :: Plot x y -> Rect -> CRender () -- | All of the model space coordinates to be plotted. These are used to -- autoscale the axes where necessary. plot_all_points_ :: Plot x y -> [(x, y)] -- | a type class abstracting the conversion of a value to a Plot. class ToPlot a toPlot :: (ToPlot a) => a x y -> Plot x y -- | Value defining a series of datapoints, and a style in which to render -- them data PlotPoints x y PlotPoints :: CairoPointStyle -> [(x, y)] -> PlotPoints x y plot_points_style_ :: PlotPoints x y -> CairoPointStyle plot_points_values_ :: PlotPoints x y -> [(x, y)] -- | When the error is symetric, we can simply pass in dx for the error -- -- Value defining a series of error intervals, and a style in which to -- render them data PlotErrBars x y PlotErrBars :: CairoLineStyle -> Double -> Double -> [ErrPoint x y] -> PlotErrBars x y plot_errbars_line_style_ :: PlotErrBars x y -> CairoLineStyle plot_errbars_tick_length_ :: PlotErrBars x y -> Double plot_errbars_overhang_ :: PlotErrBars x y -> Double plot_errbars_values_ :: PlotErrBars x y -> [ErrPoint x y] -- | Value defining a series of (possibly disjointed) lines, and a style in -- which to render them data PlotLines x y PlotLines :: CairoLineStyle -> [[(x, y)]] -> PlotLines x y plot_lines_style_ :: PlotLines x y -> CairoLineStyle plot_lines_values_ :: PlotLines x y -> [[(x, y)]] -- | Value specifying a plot filling the area between two sets of Y -- coordinates, given common X coordinates. data PlotFillBetween x y PlotFillBetween :: CairoFillStyle -> [(x, (y, y))] -> PlotFillBetween x y plot_fillbetween_style_ :: PlotFillBetween x y -> CairoFillStyle plot_fillbetween_values_ :: PlotFillBetween x y -> [(x, (y, y))] data ErrPoint x y ErrPoint :: ErrValue x -> ErrValue y -> ErrPoint x y ep_x :: ErrPoint x y -> ErrValue x ep_y :: ErrPoint x y -> ErrValue y symErrPoint :: (Num a, Num a1) => a -> a1 -> a -> a1 -> ErrPoint a a1 defaultPlotLineStyle :: CairoLineStyle defaultPlotPoints :: PlotPoints x y defaultPlotErrBars :: PlotErrBars x y defaultPlotFillBetween :: PlotFillBetween x y defaultPlotLines :: PlotLines x y plot_lines_style :: T (PlotLines x[aone] y[aonf]) CairoLineStyle plot_lines_values :: T (PlotLines x[aone] y[aonf]) ([] ([] ((,) x[aone] y[aonf]))) plot_render :: T (Plot x[aonj] y[aonk]) (PointMapFn x[aonj] y[aonk] -> CRender ()) plot_render_legend :: T (Plot x[aonj] y[aonk]) (Rect -> CRender ()) plot_all_points :: T (Plot x[aonj] y[aonk]) ([] ((,) x[aonj] y[aonk])) plot_points_style :: T (PlotPoints x[aonc] y[aond]) CairoPointStyle plot_points_values :: T (PlotPoints x[aonc] y[aond]) ([] ((,) x[aonc] y[aond])) plot_fillbetween_style :: T (PlotFillBetween x[aona] y[aonb]) CairoFillStyle plot_fillbetween_values :: T (PlotFillBetween x[aona] y[aonb]) ([] ((,) x[aona] ((,) y[aonb] y[aonb]))) plot_errbars_line_style :: T (PlotErrBars x[aon5] y[aon6]) CairoLineStyle plot_errbars_tick_length :: T (PlotErrBars x[aon5] y[aon6]) Double plot_errbars_overhang :: T (PlotErrBars x[aon5] y[aon6]) Double plot_errbars_values :: T (PlotErrBars x[aon5] y[aon6]) ([] (ErrPoint x[aon5] y[aon6])) instance (Show x, Show y) => Show (ErrPoint x y) instance (Show x) => Show (ErrValue x) instance ToPlot PlotErrBars instance ToPlot PlotFillBetween instance ToPlot PlotPoints instance ToPlot PlotLines module Graphics.Rendering.Chart.Grid data Grid a tval :: a -> Grid a tspan :: a -> Span -> Grid a empty :: Grid a nullt :: Grid a (.|.) :: Grid a -> Grid a -> Grid a (./.) :: Grid a -> Grid a -> Grid a above :: Grid a -> Grid a -> Grid a aboveN :: [Grid a] -> Grid a beside :: Grid a -> Grid a -> Grid a besideN :: [Grid a] -> Grid a overlay :: Grid t -> Grid t -> Grid t width :: Grid a -> Int height :: Grid a -> Int gridToRenderable :: Grid (Renderable a) -> Renderable a weights :: SpaceWeight -> Grid a -> Grid a instance (Show a) => Show (Grid a) instance Functor Grid module Graphics.Rendering.Chart.Legend data Legend x y Legend :: Bool -> LegendStyle -> [(String, Plot x y)] -> Legend x y data LegendStyle LegendStyle :: CairoFontStyle -> Double -> Double -> LegendStyle legend_label_style_ :: LegendStyle -> CairoFontStyle legend_margin_ :: LegendStyle -> Double legend_plot_size_ :: LegendStyle -> Double defaultLegendStyle :: LegendStyle legendToRenderable :: Legend x y -> Renderable String legend_label_style :: T LegendStyle CairoFontStyle legend_margin :: T LegendStyle Double legend_plot_size :: T LegendStyle Double instance ToRenderable (Legend x y) -- | This module glues together axes and plots to actually create a -- renderable for a chart. -- -- Note that template haskell is used to derive accessor functions (see -- Data.Accessor) for each field of the following data types: -- -- -- -- These accessors are not shown in this API documentation. They have the -- same name as the field, but with the trailing underscore dropped. -- Hence for data field f_::F in type D, they have type -- --
--   f :: Data.Accessor.Accessor D F
--   
module Graphics.Rendering.Chart.Layout -- | A Layout1 value is a single plot area, with optional: axes on each of -- the 4 sides; title at the top; legend at the bottom. It's -- parameterised by the types of values to be plotted on the horizonal -- and vertical axes. data Layout1 x y Layout1 :: CairoFillStyle -> String -> CairoFontStyle -> LayoutAxis x -> LayoutAxis x -> LayoutAxis y -> LayoutAxis y -> Double -> [(String, Either (Plot x y) (Plot x y))] -> Maybe (LegendStyle) -> Bool -> Layout1 x y layout1_background_ :: Layout1 x y -> CairoFillStyle layout1_title_ :: Layout1 x y -> String layout1_title_style_ :: Layout1 x y -> CairoFontStyle layout1_bottom_axis_ :: Layout1 x y -> LayoutAxis x layout1_top_axis_ :: Layout1 x y -> LayoutAxis x layout1_left_axis_ :: Layout1 x y -> LayoutAxis y layout1_right_axis_ :: Layout1 x y -> LayoutAxis y layout1_margin_ :: Layout1 x y -> Double layout1_plots_ :: Layout1 x y -> [(String, Either (Plot x y) (Plot x y))] layout1_legend_ :: Layout1 x y -> Maybe (LegendStyle) -- | True if the grid is to be rendered on top of the Plots layout1_grid_last_ :: Layout1 x y -> Bool data LayoutAxis x LayoutAxis :: CairoFontStyle -> String -> AxisStyle -> MAxisFn x -> Bool -> LayoutAxis x laxis_title_style_ :: LayoutAxis x -> CairoFontStyle laxis_title_ :: LayoutAxis x -> String laxis_style_ :: LayoutAxis x -> AxisStyle laxis_data_ :: LayoutAxis x -> MAxisFn x -- | True if left to right (bottom to top) is to show descending values laxis_reverse_ :: LayoutAxis x -> Bool -- | A MAxisFn is a function that generates an (optional) axis -- given the points plotted against that axis. type MAxisFn t = [t] -> Maybe (AxisData t) defaultLayout1 :: (PlotValue x, PlotValue y) => Layout1 x y -- | Create an axis when there are points to be plotted against it. mAxis :: (PlotValue t) => AxisFn t -> MAxisFn t -- | Never create an axis noAxis :: (PlotValue t) => LayoutAxis t -- | Helper to update all axis styles on a Layout1 simultaneously updateAllAxesStyles :: (AxisStyle -> AxisStyle) -> Layout1 x y -> Layout1 x y -- | Helper to update data member of both horizontal axes in a Layout1 updateXAxesData :: (MAxisFn x -> MAxisFn x) -> Layout1 x y -> Layout1 x y -- | Helper to update data member of both vertical axes in a Layout1 updateYAxesData :: (MAxisFn y -> MAxisFn y) -> Layout1 x y -> Layout1 x y -- | Helper to set the forground color uniformly on a Layout1 setForeground :: Color -> Layout1 x y -> Layout1 x y laxis_title_style :: T (LayoutAxis x[ayyK]) CairoFontStyle laxis_title :: T (LayoutAxis x[ayyK]) String laxis_style :: T (LayoutAxis x[ayyK]) AxisStyle laxis_data :: T (LayoutAxis x[ayyK]) (MAxisFn x[ayyK]) laxis_reverse :: T (LayoutAxis x[ayyK]) Bool layout1_background :: T (Layout1 x[ayyI] y[ayyJ]) CairoFillStyle layout1_title :: T (Layout1 x[ayyI] y[ayyJ]) String layout1_title_style :: T (Layout1 x[ayyI] y[ayyJ]) CairoFontStyle layout1_left_axis :: T (Layout1 x[ayyI] y[ayyJ]) (LayoutAxis y[ayyJ]) layout1_right_axis :: T (Layout1 x[ayyI] y[ayyJ]) (LayoutAxis y[ayyJ]) layout1_top_axis :: T (Layout1 x[ayyI] y[ayyJ]) (LayoutAxis x[ayyI]) layout1_bottom_axis :: T (Layout1 x[ayyI] y[ayyJ]) (LayoutAxis x[ayyI]) layout1_margin :: T (Layout1 x[ayyI] y[ayyJ]) Double layout1_plots :: T (Layout1 x[ayyI] y[ayyJ]) ([] ((,) String (Either (Plot x[ayyI] y[ayyJ]) (Plot x[ayyI] y[ayyJ])))) layout1_legend :: T (Layout1 x[ayyI] y[ayyJ]) (Maybe LegendStyle) layout1_grid_last :: T (Layout1 x[ayyI] y[ayyJ]) Bool instance (Ord x, Ord y) => ToRenderable (Layout1 x y) -- | A basic pie chart. -- -- Note that template haskell is used to derive accessor functions (see -- Data.Accessor) for each field of the following data types: -- -- -- -- These accessors are not shown in this API documentation. They have the -- same name as the field, but with the trailing underscore dropped. -- Hence for data field f_::F in type D, they have type -- --
--   f :: Data.Accessor.Accessor D F
--   
module Graphics.Rendering.Chart.Pie data PieLayout PieLayout :: String -> CairoFontStyle -> PieChart -> CairoFillStyle -> Double -> PieLayout pie_title_ :: PieLayout -> String pie_title_style_ :: PieLayout -> CairoFontStyle pie_plot_ :: PieLayout -> PieChart pie_background_ :: PieLayout -> CairoFillStyle pie_margin_ :: PieLayout -> Double data PieChart PieChart :: [PieItem] -> [Color] -> CairoFontStyle -> CairoLineStyle -> Double -> PieChart pie_data_ :: PieChart -> [PieItem] pie_colors_ :: PieChart -> [Color] pie_label_style_ :: PieChart -> CairoFontStyle pie_label_line_style_ :: PieChart -> CairoLineStyle pie_start_angle_ :: PieChart -> Double data PieItem PieItem :: String -> Double -> Double -> PieItem pitem_label_ :: PieItem -> String pitem_offset_ :: PieItem -> Double pitem_value_ :: PieItem -> Double defaultPieLayout :: PieLayout defaultPieChart :: PieChart defaultPieItem :: PieItem pie_title :: T PieLayout String pie_title_style :: T PieLayout CairoFontStyle pie_plot :: T PieLayout PieChart pie_background :: T PieLayout CairoFillStyle pie_margin :: T PieLayout Double pie_data :: T PieChart ([] PieItem) pie_colors :: T PieChart ([] Color) pie_label_style :: T PieChart CairoFontStyle pie_label_line_style :: T PieChart CairoLineStyle pie_start_angle :: T PieChart Double pitem_label :: T PieItem String pitem_offset :: T PieItem Double pitem_value :: T PieItem Double instance ToRenderable PieChart instance ToRenderable PieLayout -- | A framework for creating 2D charts in Haskell. -- -- The basic model is that you define a value of type Renderable, -- typically by applying toRenderable to some other value. This -- Renderable is then actually displayed or output by calling -- either renderableToPNGFile, or -- Graphics.Rendering.Chart.Gtk.renderableToWindow. -- -- Currently, there are two kinds of Renderable for displaying -- charts: -- -- -- -- Multiple Renderables can be composed using the -- Graphics.Rendering.Chart.Grid module. -- -- Many of the record structure involved in the API have a large number -- of fields For each record type X, there is generally a default value -- called defaultX with sensibly initialised fields - eg Layout1 -- has defaultLayout1 etc. -- -- For a simpler though less flexible API, see -- Graphics.Rendering.Chart.Simple. module Graphics.Rendering.Chart module Graphics.Rendering.Chart.Gtk renderableToWindow :: Renderable a -> Int -> Int -> IO () -- | An even simpler framework for creating 2D charts in Haskell. -- -- The basic idea is to make it as easy to plot as octave, which means -- that you provide no more information than you wish to provide. We -- provide four plotting functions, which differ only in their output. -- One produces a Layout1 that you can customize using other -- Graphics.Rendering.Chart functions. The other three produce their -- output directly. All three accept the same input (except for the -- filename required by plotPDF and plotPS), and produce the same plots. -- -- The plot functions accept a variable number of arguments. You must -- provide a [Double] which defines the points on the x axis, which must -- precede any of the y values. The y values may either be -- [Double] or functions. After any given y value, you can give either -- Strings or PlotKinds describing how you'd like that y printed. -- -- Examples: -- --
--   renderableToWindow (toRenderable $ plotLayout $ plot [0,0.1..10] sin sin(x)) 640 480
--   
-- --
--   plotWindow [0,1,3,4,8]] [12,15,1,5,8] o points
--   
-- --
--   plotPDF foo.pdf [0,0.1..10] sin -  cos .  cos o
--   
-- --
--   plotPS foo.ps [0,0.1..10] (sin.exp) -  (sin.exp) o-
--   
module Graphics.Rendering.Chart.Simple -- | The main plotting function. The idea behind PlotType is shamelessly -- copied from Text.Printf (and is not exported). All you need to know is -- that your arguments need to be in class PlotArg. And PlotArg consists -- of functions and [Double] and String and PlotKind or [PlotKind]. plot :: (PlotType a) => a -- | Type to define a few simple properties of each plot. data PlotKind Name :: String -> PlotKind FilledCircle :: PlotKind HollowCircle :: PlotKind Triangle :: PlotKind DownTriangle :: PlotKind Square :: PlotKind Diamond :: PlotKind Plus :: PlotKind Ex :: PlotKind Star :: PlotKind Symbols :: PlotKind LittleDot :: PlotKind Dashed :: PlotKind Dotted :: PlotKind Solid :: PlotKind xcoords :: [Double] -> UPlot -- | Display a plot on the screen. plotWindow :: (PlotWindowType a) => a -- | Save a plot as a PDF file. plotPDF :: (PlotPDFType a) => String -> a -- | Save a plot as a postscript file. plotPS :: (PlotPSType a) => String -> a plotLayout :: Layout1DDD -> Layout1 Double Double instance Eq PlotKind instance Show PlotKind instance Ord PlotKind instance (IsPlot p, IsPlot q) => IsPlot (p, q) instance (IsPlot p, IsPlot q, IsPlot r) => IsPlot (p, q, r) instance (IsPlot p) => IsPlot [p] instance IsPlot Char instance IsPlot Double instance IsPlot PlotKind instance PlotArg PlotKind instance PlotArg UPlot instance (Real a, Real b, Fractional a, Fractional b) => IsPlot (a -> b) instance (Real a, Real b, Fractional a, Fractional b) => PlotArg (a -> b) instance (IsPlot p) => PlotArg [p] instance PlotPNGType (IO a) instance (PlotArg a, PlotPNGType r) => PlotPNGType (a -> r) instance PlotPSType (IO a) instance (PlotArg a, PlotPSType r) => PlotPSType (a -> r) instance PlotPDFType (IO a) instance (PlotArg a, PlotPDFType r) => PlotPDFType (a -> r) instance PlotWindowType (IO a) instance (PlotArg a, PlotWindowType r) => PlotWindowType (a -> r) instance PlotType Layout1DDD instance (PlotArg a, PlotType r) => PlotType (a -> r) instance ToRenderable Layout1DDD