You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you need to extend the default Chart.js charts. There are a lot of examples how to extend and modify the default charts. Or you want to create a own chart type.
285
+
286
+
In `vue-chartjs` you can do this pretty much the same way.
287
+
288
+
```js
289
+
// 1. Import Chart.js so you can use the global Chart object
290
+
importChartfrom'chart.js'
291
+
// 2. Import the `generateChart()` method to create the vue component.
You can use `vue-chartjs` directly in the browser without any build setup, like in this [codepen](https://codepen.io/apertureless/pen/vxWbqB?editors=1010). In this case, please use the `vue-chartjs.full.min.js` which is the minified version. It has Vue.js and Chart.js bundled into it and is bundled to a UMD module, so you only need that one file.
340
-
341
-
342
-
### Browserify / Webpack 1
343
-
344
-
If you're using Gulp, Browserify or Webpack 1 the entry is `vue-chartjs.js` which is __transpiled__ and __bundled__ UMD Module.
345
-
346
-
However Vue.js and Chart.js are `peerDependencies` so you have to install them separately. In most projects you will have Vue.js already installed anyways. This way, you can have different versions of Vue.js and Chart.js then in this package.
347
-
348
-
### Webpack 2
349
-
If you're using Webpack 2 it will automatically use the `jsnext:main` / `module` entry point, which is `es/index.js`. It is a __transpiled__ es version of the source and is not __bundled__ to a module. This way your tree shaking will work. Like in the bundled version, Vue.js and Chart.js are `peerDependencies` and need to be installed.
350
-
351
351
## Resources
352
352
353
353
You can find here some resources like tutorials on how to use `vue-chartjs`
0 commit comments