taffybar-0.4.3: A desktop bar similar to xmobar, but with more GUI

Safe HaskellNone
LanguageHaskell2010

System.Taffybar.Widgets.Graph

Contents

Description

This is a graph widget inspired by the widget of the same name in Awesome (the window manager). It plots a series of data points similarly to a bar graph. This version must be explicitly fed data with graphAddSample. For a more automated version, see PollingGraph.

Like Awesome, this graph can plot multiple data sets in one widget. The data sets are plotted in the order provided by the caller.

Note: all of the data fed to this widget should be in the range [0,1].

Synopsis

Types

data GraphConfig Source

The configuration options for the graph. The padding is the number of pixels reserved as blank space around the widget in each direction.

Constructors

GraphConfig 

Fields

graphPadding :: Int

Number of pixels of padding on each side of the graph widget

graphBackgroundColor :: (Double, Double, Double)

The background color of the graph (default black)

graphBorderColor :: (Double, Double, Double)

The border color drawn around the graph (default gray)

graphBorderWidth :: Int

The width of the border (default 1, use 0 to disable the border)

graphDataColors :: [(Double, Double, Double, Double)]

Colors for each data set (default cycles between red, green and blue)

graphDataStyles :: [GraphStyle]

How to draw each data point (default repeat Area)

graphHistorySize :: Int

The number of data points to retain for each data set (default 20)

graphLabel :: Maybe String

May contain Pango markup (default Nothing)

graphWidth :: Int

The width (in pixels) of the graph widget (default 50)

graphDirection :: GraphDirection
 

data GraphStyle Source

The style of the graph. Generally, you will want to draw all Area graphs first, and then all Line graphs.

Constructors

Area

Thea area below the value is filled

Line

The values are connected by a line (one pixel wide)

Functions

graphAddSample :: GraphHandle -> [Double] -> IO () Source

Add a data point to the graph for each of the tracked data sets. There should be as many values in the list as there are data sets.