hs-gchart-0.4.2: Haskell wrapper for the Google Chart API

Safe HaskellSafe
LanguageHaskell2010

Graphics.GChart.Types

Contents

Description

Synopsis

Typeclasses

Typeclasses for abstraction

type ChartM a = State Chart a Source #

Chart monad which wraps a State monad in turn to keep track of the chart state and make it convenient to update it

class ChartItem c where Source #

Typeclass abstracting all the fields in a chart

Methods

set :: c -> ChartM () Source #

sets the item in a chart

encode :: c -> [(String, String)] Source #

encode the field into a list string params that can then be converted into a query string URL

Instances
ChartItem ChartLabelData Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Data

ChartItem QREncoding Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Data

ChartItem ChartLineStyles Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Styles

ChartItem BarChartWidthSpacing Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Styles

ChartItem ChartMargins Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Styles

ChartItem PieChartOrientation Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Styles

ChartItem ChartLabels Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Labels

ChartItem ChartMarkers Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Styles

ChartItem ChartGrid Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Styles

ChartItem ChartAxes Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Labels

ChartItem ChartLegend Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Labels

ChartItem ChartFills Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Colors

ChartItem ChartColors Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Colors

ChartItem ChartData Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Data

ChartItem ChartDataScales Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Data

ChartItem ChartTitle Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Labels

ChartItem ChartType Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Basics

ChartItem ChartSize Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Basics

class Num a => ChartDataEncodable a where Source #

Typeclass abstracting the numeric data that can be encoded. This helps in passing Int and Float values as chart data, which are then encoded correctly

Methods

addEncodedChartData :: [a] -> ChartData -> ChartData Source #

Adds the array of numeric data to the existing chart data. Throws a error if the data passed in doesnt match with the current data encoding format.

Chart

Data type to represent the chart

Chart Parameters

Some of these parameters behave differently depending on the chart type;

More details : http://code.google.com/apis/chart/docs/chart_params.html

Bar Width and Spacing

data BarWidth Source #

Bar Width

Constructors

Automatic

Automatic resizing

BarWidth Int

Bar width in pixels

data BarGroupSpacing Source #

Bar and Group Spacing

Constructors

Fixed (Int, Int)

Fixed spacing values in pixels

Relative (Float, Float)

Relative values as percentages

Series Colors

data ChartColors Source #

Chart colors specified as a list of Color values for each data point.

Constructors

ChartColors [Color] 

type Color = String Source #

Color data specified as a hex string

Chart Data

data ChartData Source #

Chart data along with encoding. XY data for is encoded a pair of consecutive data sets

Constructors

Simple [[Int]]

lets you specify integer values from 0-61, inclusive

Text [[Float]]

supports floating point numbers from 0-100, inclusive

Extended [[Int]]

lets you specify integer values from 0-4095, inclusive

Instances
Show ChartData Source # 
Instance details

Defined in Graphics.GChart.Types

ChartItem ChartData Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Data

data ChartDataScales Source #

List of Data scaling values

Constructors

CDS [DataScale] 

type DataScale = (Float, Float) Source #

Data scaling expressed as (series_min,series_max). Applies to text encoding only

Chart Legend Text and Style

data LegendPosition Source #

Position of legend on chart. Applies to ChartLegend

Constructors

LegendBottom

Bottom of chart, horizontally

LegendTop

Top of chart, horizontally

LegendVBottom

Bottom of chart, vertically

LegendVTop

Bottom of chart, vertically

LegendRight

Left of chart

LegendLeft

Right of chart

Solid, Gradient and Striped Fills

type ChartFills = [Fill] Source #

Chart fills, as a list of Fills

data Fill Source #

Constructor for a chart fill

Constructors

Fill FillKind FillType 
Instances
Show Fill Source # 
Instance details

Defined in Graphics.GChart.Types

Methods

showsPrec :: Int -> Fill -> ShowS #

show :: Fill -> String #

showList :: [Fill] -> ShowS #

ChartItem ChartFills Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Colors

data FillKind Source #

Specifies the kind of fill

Constructors

Solid Color

Solid Fill

LinearGradient Angle [(Color, Offset)]

Linear Gradient

LinearStripes Angle [(Color, Width)]

Linear Stripes

Instances
Show FillKind Source # 
Instance details

Defined in Graphics.GChart.Types

data FillType Source #

Specifies the type of fill

Constructors

Background

Background fill

Area

Chart area fill

Transparent

Apply transparency to whole chart (applicable to Solid fill only)

Instances
Show FillType Source # 
Instance details

Defined in Graphics.GChart.Types

type Offset = Float Source #

Specifies at what point the color is pure. In this parameter, 0 specifies the right-most chart position and 1 specifies the left-most chart position. Applicable to LinearGradient

type Width = Float Source #

Width of the stripe. must be between 0 and 1, where 1 is the full width of the chart

type Angle = Float Source #

Angle of the gradient between 0 (horizontal) and 90 (vertical). Applicable to LinearGradient and LinearStripes

Grid Lines

data ChartGrid Source #

Grid Lines for Chart

Constructors

ChartGrid 

Fields

Instances
Show ChartGrid Source # 
Instance details

Defined in Graphics.GChart.Types

ChartItem ChartGrid Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Styles

Pie chart labels, Google-o-meter label (TODO: QR code data, Formula TeX data)

data ChartLabels Source #

Labels for Pie Chart and Google-o-meter. Specify a list with a single label for Google-o-meter

Constructors

ChartLabels [String] 

Chart Label Data

data ChartLabelData Source #

Chart Label Data. Applies to QRCode

Constructors

QRLabelData ErrorCorrectionLevel Int

Error Correction Level and Margin (as no. of rows)

data ErrorCorrectionLevel Source #

Error Correction Level for QR Code

Constructors

L'

recovery of up to 7% data loss

M'

recovery of up to 15% data loss

Q'

recovery of up to 25% data loss

H'

recovery of up to 30% data loss

Line Styles

data LineStyle Source #

Line Style. Applicable for line charts

Constructors

LS 

Fields

Line, Shape, Range and Financial Markers

data AnyChartMarker Source #

Data type to abstract over all kinds of ChartMarker

Constructors

ChartMarker w => AnyChartMarker w 

data LineWhichPoints Source #

Which points in a series to use to draw the line.

Constructors

PointsAll

Use all the points in the series.

Points (Maybe Float, Maybe Float)

(start,end) indicating a specific range of points

data LineMarker Source #

Line Marker

Constructors

LM 

Fields

data ShapeType Source #

Shape type of ShapeMarker

Constructors

ShapeArrow

Arrow

ShapeCross

Cross

ShapeRectangle

Rectangle

ShapeDiamond

Diamond

ShapeErrorBarMarker

Error Bar Marker

HorizontalLine

Horizontal line across the chart at specified height

HorizontalLineFull

Horizontal line through the specified data marker

ShapeCircle

Circle

ShapeSquare

Square

VerticalLine

Vertical line from x-axis to data point

VerticalLineFull

Vertical line across the chart

ShapeX

X shape

Instances
Show ShapeType Source # 
Instance details

Defined in Graphics.GChart.Types

data MarkerDataPoint Source #

Data point value of ShapeMarker

Constructors

DataPoint Float

A specific data point in the dataset. Use a decimal value to interpolate between two points

DataPointEvery

Draw a marker on each data point

DataPointEveryN Int

Draw a marker on every n-th data point

DataPointEveryNRange (Int, Int) Int

(x,y), n draw a marker on every n-th data point in a range, where x is the first data point in the range, and y is the last data point in the range

DataPointXY (Float, Float)

draw a marker at a specific point (x,y). Specify the coordinates as floating point values, where 0:0 is the bottom left corner of the chart, 0.5:0.5 is the center of the chart, and 1:1 is the top right corner of the chart

data ShapeMarker Source #

Shape Marker

Constructors

SM 

Fields

data RangeMarker Source #

Range Marker

Constructors

RM 

Fields

  • rangeMarkerType :: RangeMarkerType

    Range marker type

  • rangeMarkerColor :: Color

    Range marker color

  • rangeMarkerRange :: (Float, Float)

    (start,end) range. For horizontal range markers, the (start,end) value is a position on the y-axis, where 0.00 is the bottom of the chart, and 1.00 is the top of the chart. For vertical range markers, the (start,end) value is a position on the x-axis, where 0.00 is the left of the chart, and 1.00 is the right of the chart.

data FinancialMarker Source #

Financial Marker, for line charts and vertical bar charts

Constructors

FM 

Fields

Line Fills

data LineFillType Source #

Line fill type for LineFill

Constructors

LineFillFrom Int

Line fill starting from a start index

LineFillBetween Int Int

Line fill between a start index and end index

Instances
Show LineFillType Source # 
Instance details

Defined in Graphics.GChart.Types

Chart Margins

data ChartMargins Source #

Chart Margins. All margin values specified are the minimum margins around the plot area, in pixels.

Constructors

ChartMargins 

Fields

QR code output encoding

data QREncoding Source #

QR Code Output Encoding

Constructors

UTF8 
Shift_JIS 
ISO8859_1 

Pie Chart Orientation

data PieChartOrientation Source #

Pie Chart Orientation. Applicable only to Pie Charts,

Constructors

PCO Float 

Chart Size

data ChartSize Source #

Size of the chart. width and height specified in pixels

Constructors

Size Int Int 
Instances
Show ChartSize Source # 
Instance details

Defined in Graphics.GChart.Types

ChartItem ChartSize Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Basics

Chart Type

data ChartType Source #

Chart type

Constructors

Line

Line Chart

Sparklines

Sparklines

LineXY

Line Chart w/ XY co-ordinates

BarHorizontalStacked

Horizontal bar chart w/ stacked bars

BarVerticalStacked

Vertical bar chart w/ stacked bars

BarHorizontalGrouped

Horizontal bar chart w/ grouped bars

BarVerticalGrouped

Vertical bar chart w/ grouped bars

Pie

Two dimensional pie chart

Pie3D

Three dimensional pie chart

PieConcentric

Concentric pie chart

Venn

Venn Diagram

ScatterPlot

Scatter Plot

Radar

Radar Chart

RadarCurvedLines

Radar Chart, connects points with curved lines

GoogleOMeter

Google-o-meter

Formula

Formula Chart

QRCode

QR Codes

Instances
Show ChartType Source # 
Instance details

Defined in Graphics.GChart.Types

ChartItem ChartType Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Basics

Chart Title and Style

data ChartTitle Source #

Title of the chart

Constructors

ChartTitle 

Fields

Visible Axis Axis styles and labels

type ChartAxes = [Axis] Source #

List of Axis for chart

data Axis Source #

Visible axis

Instances
Show Axis Source # 
Instance details

Defined in Graphics.GChart.Types

Methods

showsPrec :: Int -> Axis -> ShowS #

show :: Axis -> String #

showList :: [Axis] -> ShowS #

ChartItem ChartAxes Source # 
Instance details

Defined in Graphics.GChart.ChartItems.Labels

data AxisType Source #

Type of Axis

Constructors

AxisBottom

Bottom x-axis

AxisTop

Top x-axis

AxisLeft

Left y-axis

AxisRight

Right y-axis

Instances
Show AxisType Source # 
Instance details

Defined in Graphics.GChart.Types

type AxisLabel = String Source #

Axis Labels.

type AxisPosition = Float Source #

Axis Label Positions.

Labels with a specified position of 0 are placed at the bottom of the y- or r-axis, or at the left of the x- or t-axis.

Labels with a specified position of 100 are placed at the top of the y- or r-axis, or at the right of the x- or t-axis.

type FontSize = Int Source #

Font size in pixels. Applicable to AxisStyle and ChartTitle

data AxisRange Source #

Axis Range

The range is specifies with a tuple containing the start and end values. An optional interval value can be specified.

Constructors

Range (Float, Float) (Maybe Float) 
Instances
Eq AxisRange Source # 
Instance details

Defined in Graphics.GChart.Types

Show AxisRange Source # 
Instance details

Defined in Graphics.GChart.Types

data DrawingControl Source #

Control drawing of Axis. Applicable to AxisStyle

Constructors

DrawLines

Draw axis lines only

DrawTicks

Draw tick marks only

DrawLinesTicks

Draw axis lines and tick marks

data AxisStyleAlignment Source #

Alignment of Axis labels. Applies to AxisStyle

Constructors

AxisStyleLeft

Left aligned labels

AxisStyleCenter

Centered labels

AxisStyleRight

Right aligned labels

Default Values

These functions return default values for complex parameters, which can be used as starting points to construct parameters when creating charts.

defaultChart :: Chart Source #

Default value for a chart

defaultAxis :: Axis Source #

Default value for an axis

defaultGrid :: ChartGrid Source #

Default value for a chart grid

defaultSpacing :: BarGroupSpacing Source #

Default value for bar and group spacing in bar chart

defaultShapeMarker :: ShapeMarker Source #

Default value of a shape marker. Make sure you change the value of shapeDataSetIdx

defaultRangeMarker :: RangeMarker Source #

Default value of range marker

defaultFinancialMarker :: FinancialMarker Source #

Default value of a financial marker. Make sure you change the value of financeDataSetIdx

defaultLineStyle :: LineStyle Source #

Default value of a line style

defaultLineMarker :: LineMarker Source #

Default value of a line marker. Make sure you change the value of lineDataSetIdx

defaultQREncodingLabelData :: ChartLabelData Source #

Default chart label data for QR Encoding