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
Copy file name to clipboardExpand all lines: README.md
-12Lines changed: 0 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,18 +71,6 @@ Vue.component('line-chart', {
71
71
})
72
72
```
73
73
74
-
75
-
### Browserify / Webpack 1
76
-
77
-
If you're using Gulp, Browserify or Webpack 1 the entry is `vue-chartjs.js` which is __transpiled__ and __bundled__ UMD Module.
78
-
79
-
However, Chart.js is a `peerDependencies` so you have to install it separately. In most projects This way, you can have different versions of Chart.js then in this package.
80
-
81
-
### Webpack 2
82
-
If you're using Webpack 2 it will automatically use the `jsnext:main` / `module` entry point. Which is `es/index.js`
83
-
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, `Chart.js` is a `peerDependencies` and need to be installed.
84
-
85
-
86
74
## How to use
87
75
88
76
You need to import the component and then either use `extends` or `mixins` and add it.
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