Graphics.GChart.Types
Contents
Description
This module contains the Haskell data model for the Google Chart API.
Details about the parameters can be found on the Google Chart API website : http://code.google.com/apis/chart/
Some chart types are not supported yet :
- Maps http://code.google.com/apis/chart/types.html#maps
- QRCodes http://code.google.com/apis/chart/types.html#qrcodes
Some parameters are not supported yet :
- Data Scaling http://code.google.com/apis/chart/formats.html#data_scaling
- Shape markers http://code.google.com/apis/chart/styles.html#shape_markers
- Range markers http://code.google.com/apis/chart/styles.html#range_markers
- Financial markers http://code.google.com/apis/chart/styles.html#financial_markers
- Line Styles http://code.google.com/apis/chart/styles.html#line_styles
- Fill area http://code.google.com/apis/chart/colors.html#fill_area_marker
- Bar width and spacing http://code.google.com/apis/chart/styles.html#bar_width
- Bar chart zero line http://code.google.com/apis/chart/styles.html#zero_line
- Data point labels http://code.google.com/apis/chart/labels.html#data_point_labels
- Chart margins http://code.google.com/apis/chart/styles.html#chart_margins
- Chart title color and font customisation http://code.google.com/apis/chart/labels.html#chart_title
- Pie chart orientation http://code.google.com/apis/chart/types.html#pie_charts
- data Chart = Chart {}
- data ChartSize = Size Int Int
- data ChartData
- data ChartType
- = Line
- | Sparklines
- | LineXY
- | BarHorizontalStacked
- | BarVerticalStacked
- | BarHorizontalGrouped
- | BarVerticalGrouped
- | Pie
- | Pie3D
- | PieConcentric
- | Venn
- | ScatterPlot
- | Radar
- | GoogleOMeter
- data ChartColors = ChartColors [Color]
- type Color = String
- type ChartFills = [Fill]
- data Fill = Fill FillKind FillType
- data FillKind
- = Solid Color
- | LinearGradient Angle [(Color, Offset)]
- | LinearStripes Angle [(Color, Width)]
- data FillType
- = Background
- | Area
- | Transparent
- type Offset = Float
- type Width = Float
- type Angle = Float
- type ChartTitle = String
- data ChartLegend = Legend [String] (Maybe LegendPosition)
- data LegendPosition
- = LegendBottom
- | LegendTop
- | LegendVBottom
- | LegendVTop
- | LegendRight
- | LegendLeft
- type ChartAxes = [Axis]
- data Axis = Axis {}
- data AxisType
- = AxisBottom
- | AxisTop
- | AxisLeft
- | AxisRight
- type AxisLabel = String
- type AxisPosition = Float
- type FontSize = Int
- data AxisRange = Range (Float, Float) (Maybe Float)
- data AxisStyle = Style {}
- data DrawingControl
- = DrawLines
- | DrawTicks
- | DrawLinesTicks
- data AxisStyleAlignment
- data ChartGrid = ChartGrid {}
- data ChartLabels = ChartLabels [String]
- defaultChart :: Chart
- defaultAxis :: Axis
- defaultGrid :: ChartGrid
Chart data
This type represents the Chart
Data type for the chart
Constructors
| Chart | |
Fields | |
Required Parameters
These parameters are required for all charts
Chart Size
Size of the chart. width and height specified in pixels
Chart Data
Chart data along with encoding. XY data for is encoded a pair of | consecutive data sets | http://code.google.com/apis/chart/formats.html
Chart Type
Chart type http://code.google.com/apis/chart/types.html
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 |
| GoogleOMeter | Google-o-meter |
Optional Parameters
All other parameters are optional
Chart Colors
data ChartColors Source
Chart colors specified as a list of Color values for each data point.
| http://code.google.com/apis/chart/colors.html#chart_colors
Constructors
| ChartColors [Color] |
Instances
| Show ChartColors | |
| ChartItem ChartColors |
Solid Fill, Linear Gradient, Linear Stripes
type ChartFills = [Fill]Source
Chart fills, as a list of Fills
Specifies the kind of fill
Constructors
Specifies the type of fill
Constructors
| Background | Background fill |
| Area | Chart area fill |
| Transparent | Apply transparency to whole chart (applicable to |
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
Width of the stripe. must be between 0 and 1, where 1 is the full width of | the chart
Specifies the angle of the gradient between 0 (horizontal) and 90
| (vertical). Applicable to LinearGradient and LinearStripes
Chart Title
type ChartTitle = StringSource
Title of the chart | http://code.google.com/apis/chart/labels.html#chart_title
Chart Legend
data ChartLegend Source
Specifies a chart legend | http://code.google.com/apis/chart/labels.html#chart_legend
Constructors
| Legend [String] (Maybe LegendPosition) |
Instances
| Show ChartLegend | |
| ChartItem ChartLegend |
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 |
Instances
Axis styles and labels
Specify an axis for chart. | http://code.google.com/apis/chart/labels.html#axis_styles
Constructors
| Axis | |
Fields
| |
Constructors
| AxisBottom | Bottom x-axis |
| AxisTop | Top x-axis |
| AxisLeft | Left y-axis |
| AxisRight | Right y-axis |
type AxisPosition = FloatSource
Axis Label Positions. http://code.google.com/apis/chart/labels.html#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.
Axis Range http://code.google.com/apis/chart/labels.html#axis_range
The range is specifies with a tuple containing the start and end values. An optional interval value can be specified.
Specify Axis style
| http://code.google.com/apis/chart/labels.html#axis_styles
Constructors
| Style | |
Fields | |
data DrawingControl Source
Constructors
| DrawLines | Draw axis lines only |
| DrawTicks | Draw tick marks only |
| DrawLinesTicks | Draw axis lines and tick marks |
Instances
data AxisStyleAlignment Source
Constructors
| AxisStyleLeft | Left aligned labels |
| AxisStyleCenter | Centered labels |
| AxisStyleRight | Right aligned labels |
Instances
Grid Lines
Grid Lines for Chart | http://code.google.com/apis/chart/styles.html#grid
Constructors
| ChartGrid | |
Pie chart and Google-o-meter labels
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] |
Instances
| Show ChartLabels | |
| ChartItem ChartLabels |
Default Values
These functions return default values for complex parameters, which can be used as starting points to construct parameters when creating charts.