From a996049a6b6371f01a75f24f6e053a331036dfcc Mon Sep 17 00:00:00 2001 From: Jakub Juszczak Date: Tue, 4 Jul 2017 10:44:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs=20with=20inline-pl?= =?UTF-8?q?ugin=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/README.md b/docs/README.md index a6cf11f..bc68e13 100644 --- a/docs/README.md +++ b/docs/README.md @@ -255,6 +255,26 @@ export default Line.extend({ Sometimes you need more control over chart.js. Thats why you can access the chart.js instance over `this._chart` +## Inline plugins + +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. + +If you want to add inline plugins, `vue-chartjs` exposes a helper method called `addPlugin()` +You should call `addPlugin()` before the `renderChart()` method. + +### Example + +```javascript +mounted () { + this.addPlugin({ + id: 'my-plugin', + beforeInit: function (chart) { + .... + } + }) +} +``` + ## Available Charts ### Bar Chart