js-chart-2.9.4.1: Obtain minified chart.js code
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Javascript.Chart

Description

Module for accessing minified chart code (http://www.chartjs.org/). As an example:

import qualified Language.Javascript.Chart as Chart

main = do
    putStrLn $ "Chart version " ++ show Chart.version ++ " source:"
    putStrLn =<< readFile =<< Chart.file Chart.Chart

This package installs data files containing the chart.js sources, which must be available at runtime. If you want to produce an executable with no dependency on associated data files, you can use the file-embed library (https://hackage.haskell.org/package/file-embed):

{-# LANGUAGE TemplateHaskell #-}

import Data.FileEmbed
import qualified Data.ByteString as BS
import qualified Language.Javascript.Chart as Chart
import Language.Haskell.TH.Syntax

main = print chartContents

chartContents :: BS.ByteString
chartContents = $(embedFile =<< runIO (Chart.file Chart.Chart))
Synopsis

Documentation

data Chart Source #

The Chart code to obtain.

Constructors

Chart

The base chart.js system.

ChartBundle

The base system, plus a compliant version of the moment.js time and date library.

ChartCSS

chart.js CSS, usually unnecessary. See here.

Instances

Instances details
Bounded Chart Source # 
Instance details

Defined in Language.Javascript.Chart

Enum Chart Source # 
Instance details

Defined in Language.Javascript.Chart

Eq Chart Source # 
Instance details

Defined in Language.Javascript.Chart

Methods

(==) :: Chart -> Chart -> Bool #

(/=) :: Chart -> Chart -> Bool #

Data Chart Source # 
Instance details

Defined in Language.Javascript.Chart

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Chart -> c Chart #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Chart #

toConstr :: Chart -> Constr #

dataTypeOf :: Chart -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Chart) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Chart) #

gmapT :: (forall b. Data b => b -> b) -> Chart -> Chart #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Chart -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Chart -> r #

gmapQ :: (forall d. Data d => d -> u) -> Chart -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Chart -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Chart -> m Chart #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Chart -> m Chart #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Chart -> m Chart #

Ord Chart Source # 
Instance details

Defined in Language.Javascript.Chart

Methods

compare :: Chart -> Chart -> Ordering #

(<) :: Chart -> Chart -> Bool #

(<=) :: Chart -> Chart -> Bool #

(>) :: Chart -> Chart -> Bool #

(>=) :: Chart -> Chart -> Bool #

max :: Chart -> Chart -> Chart #

min :: Chart -> Chart -> Chart #

Read Chart Source # 
Instance details

Defined in Language.Javascript.Chart

Show Chart Source # 
Instance details

Defined in Language.Javascript.Chart

Methods

showsPrec :: Int -> Chart -> ShowS #

show :: Chart -> String #

showList :: [Chart] -> ShowS #

version :: Version Source #

The version of Chart provided by this package. Not necessarily the version of this package, but the versions will match in the first three digits.

file :: Chart -> IO FilePath Source #

A local file containing the minified chart.js code for version.