Skip to content

Commit a996049

Browse files
committed
πŸ“ Update docs with inline-plugin support
1 parent b23ce23 commit a996049

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

β€Ždocs/README.mdβ€Ž

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,26 @@ export default Line.extend({
255255

256256
Sometimes you need more control over chart.js. Thats why you can access the chart.js instance over `this._chart`
257257

258+
## Inline plugins
259+
260+
In Chart.js you can define global and inline plugins. Global plugins are working without problems with `vue-chartjs` like in the [chart.js docs](http://www.chartjs.org/docs/latest/developers/plugins.html) described.
261+
262+
If you want to add inline plugins, `vue-chartjs` exposes a helper method called `addPlugin()`
263+
You should call `addPlugin()` before the `renderChart()` method.
264+
265+
### Example
266+
267+
```javascript
268+
mounted () {
269+
this.addPlugin({
270+
id: 'my-plugin',
271+
beforeInit: function (chart) {
272+
....
273+
}
274+
})
275+
}
276+
```
277+
258278
## Available Charts
259279

260280
### Bar Chart

0 commit comments

Comments
Β (0)