Language.Javascript.Chart

js-chart-2.9.4.1: Obtain minified chart.js code

Safe Haskell | Safe-Inferred
Language | Haskell2010

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

- data Chart
  - = Chart
  - | ChartBundle
  - | ChartCSS
- version :: Version
- file :: Chart -> IO FilePath

# Documentation

data Chart #

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

Data Chart # |
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 #
Bounded Chart # |
Instance details Defined in Language.Javascript.Chart Methods minBound :: Chart # maxBound :: Chart #
Enum Chart # |
Instance details Defined in Language.Javascript.Chart Methods succ :: Chart -> Chart # pred :: Chart -> Chart # toEnum :: Int -> Chart # fromEnum :: Chart -> Int # enumFrom :: Chart -> [Chart] # enumFromThen :: Chart -> Chart -> [Chart] # enumFromTo :: Chart -> Chart -> [Chart] # enumFromThenTo :: Chart -> Chart -> Chart -> [Chart] #
Read Chart # |
Instance details Defined in Language.Javascript.Chart Methods readsPrec :: Int -> ReadS Chart # readList :: ReadS [Chart] # readPrec :: ReadPrec Chart # readListPrec :: ReadPrec [Chart] #
Show Chart # |
Instance details Defined in Language.Javascript.Chart Methods showsPrec :: Int -> Chart -> ShowS # show :: Chart -> String # showList :: [Chart] -> ShowS #
Eq Chart # |
Instance details Defined in Language.Javascript.Chart Methods (==) :: Chart -> Chart -> Bool # (/=) :: Chart -> Chart -> Bool #
Ord Chart # |
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 #

version :: Version #

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 #

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