GrapesJS Plugin to integrate Chart.js into your GrapesJS editor.
npm install grapesjs-chartjs-plugin
:star: Star me on GitHub — it motivates me a lot!
grapesjs-chartjs-plugin
chartjs
chartjs-bar
chartjs-line
chartjs-pie
chartjs-doughnut
chartjs-polarArea
chartjs-radar
chartjs-bubble
chartjs-scatter
chartjsOptions | This object will be passed directly to the underlying Chart.js options. See here for more info. | { maintainAspectRatio: false } |
blocks | Which blocks to add. | [ "chartjs-bar", "chartjs-line", "chartjs-pie", "chartjs-doughnut", "chartjs-polarArea", "chartjs-radar", "chartjs-bubble", "chartjs-scatter" ] |
category | Category name. By default the category value of the i18n en locale file will be used. | { id: 'chartjs', label: "Charts" } |
i18n | Object used to translate plugin properties. Check the en locale file and follow its inner path. | en |
https://unpkg.com/grapesjs-chartjs-plugin
npm i grapesjs-chartjs-plugin
git clone https://github.com/fasenderos/grapesjs-chartjs-plugin.git
html
href="https://unpkg.com/grapesjs/dist/css/grapes.min.css"
rel="stylesheet"
/>
`
Modern javascript
`js
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-chartjs-plugin';
import 'grapesjs/dist/css/grapes.min.css';
const editor = grapesjs.init({
container : '#gjs',
// ...
plugins: [plugin],
pluginsOpts: {
[plugin]: { / options / }
}
// or
plugins: [
editor => plugin(editor, { / options / }),
],
});
`
Development
Clone the repository
`sh
$ git clone https://github.com/fasenderos/grapesjs-chartjs-plugin.git
$ cd grapesjs-chartjs-plugin
`
Install dependencies
`sh
$ npm i
`
Start the dev server
`sh
$ npm start
`
Build the source
`sh
$ npm run build
``