Merge pull request #206 from labtocat/master
Updated docs for es-modules like VueJS to work (import correction and including css)
This commit is contained in:
commit
4b6a558631
22
README.md
22
README.md
@ -50,6 +50,13 @@
|
|||||||
import { Chart } from "frappe-charts"
|
import { Chart } from "frappe-charts"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
...or include following for es-modules(eg:vuejs):
|
||||||
|
```js
|
||||||
|
import { Chart } from 'frappe-charts/dist/frappe-charts.esm.js'
|
||||||
|
// import css
|
||||||
|
import 'frappe-charts/dist/frappe-charts.min.css'
|
||||||
|
```
|
||||||
|
|
||||||
* ...or include within your HTML
|
* ...or include within your HTML
|
||||||
|
|
||||||
```html
|
```html
|
||||||
@ -86,6 +93,21 @@ const chart = new frappe.Chart("#chart", { // or a DOM element,
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
...or for es-modules:
|
||||||
|
```js
|
||||||
|
|
||||||
|
//replace new frappe.Chart() with new Chart()
|
||||||
|
const chart = new Chart("#chart", { // or a DOM element,
|
||||||
|
// new Chart() in case of ES6 module with above usage
|
||||||
|
title: "My Awesome Chart",
|
||||||
|
data: data,
|
||||||
|
type: 'axis-mixed', // or 'bar', 'line', 'scatter', 'pie', 'percentage'
|
||||||
|
height: 250,
|
||||||
|
colors: ['#7cd6fd', '#743ee2']
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
If you want to contribute:
|
If you want to contribute:
|
||||||
|
|
||||||
1. Clone this repo.
|
1. Clone this repo.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user