All Projects → timdeputter → purescript-apexcharts

timdeputter / purescript-apexcharts

Licence: MIT License
Purescript bindings for apexcharts.js (https://apexcharts.com)

Programming Languages

purescript
368 projects
javascript
184084 projects - #8 most used programming language
Dhall
116 projects

purescript-apexcharts GitHub purescript-apexcharts on Pursuit

Purescript bindings for apexcharts.js - "A modern JavaScript charting library to build interactive charts and visualizations with simple API" (https://apexcharts.com)

State

Basically all options should work. Only some options that take functions (events, formatters) are missing. PRS welcome!

Download and Installation

Install apexcharts first (https://apexcharts.com/docs/installation/).

npm install apexcharts --save
bower install --save purescript-apexcharts

Basic example

The basic example from the apexcharts.js readme:

var options = {
  chart: {
    type: 'bar'
  },
  series: [
    {
      name: 'sales',
      data: [30, 40, 35, 50, 49, 60, 70, 91, 125]
    }
  ],
  xaxis: {
    categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]
  }
}

var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()

The equivalent in purescript:

let chart = (
        chart := (type' := Bar) 
        <> series := [
          name := "sales"
          <> data' := [30,40,35,50,49,60,70,91,125]
        ]
        <> xaxis := (
          categories := [1991,1992,1993,1994,1995,1996,1997,1998,1999]
        )
    )
in render $ createChart "#chart" chart

More examples here.

Documentation

Module documentation is published on Pursuit.

License

Check LICENSE file for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].