https://github.com/timdeputter/purescript-apexcharts
Purescript bindings for apexcharts.js (https://apexcharts.com)
https://github.com/timdeputter/purescript-apexcharts
Last synced: over 1 year ago
JSON representation
Purescript bindings for apexcharts.js (https://apexcharts.com)
- Host: GitHub
- URL: https://github.com/timdeputter/purescript-apexcharts
- Owner: timdeputter
- License: mit
- Created: 2020-04-20T11:56:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-29T13:15:08.000Z (about 2 years ago)
- Last Synced: 2025-01-25T13:07:08.195Z (over 1 year ago)
- Language: PureScript
- Size: 270 KB
- Stars: 18
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-apexcharts [](https://github.com/timdeputter/purescript-apexcharts/blob/master/LICENSE) [
](https://pursuit.purescript.org/packages/purescript-apexcharts)
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/).
```bash
npm install apexcharts --save
bower install --save purescript-apexcharts
```
## Basic example
The basic example from the apexcharts.js readme:
```javascript
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:
```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 createChart "#chart" chart >>= render
```
More examples [here](https://github.com/timdeputter/purescript-apexcharts/tree/master/examples).
## Documentation
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-apexcharts).
## License
Check [LICENSE](LICENSE) file for more information.