first commit
This commit is contained in:
36
WebRoot/node_modules/chart.js/docs/getting-started/integration.md
generated
vendored
Normal file
36
WebRoot/node_modules/chart.js/docs/getting-started/integration.md
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# Integration
|
||||
|
||||
Chart.js can be integrated with plain JavaScript or with different module loaders. The examples below show how to load Chart.js in different systems.
|
||||
|
||||
## ES6 Modules
|
||||
|
||||
```javascript
|
||||
import Chart from 'chart.js';
|
||||
var myChart = new Chart(ctx, {...});
|
||||
```
|
||||
|
||||
## Script Tag
|
||||
|
||||
```html
|
||||
<script src="path/to/chartjs/dist/Chart.js"></script>
|
||||
<script>
|
||||
var myChart = new Chart(ctx, {...});
|
||||
</script>
|
||||
```
|
||||
|
||||
## Common JS
|
||||
|
||||
```javascript
|
||||
var Chart = require('chart.js');
|
||||
var myChart = new Chart(ctx, {...});
|
||||
```
|
||||
|
||||
## Require JS
|
||||
|
||||
```javascript
|
||||
require(['path/to/chartjs/dist/Chart.js'], function(Chart){
|
||||
var myChart = new Chart(ctx, {...});
|
||||
});
|
||||
```
|
||||
|
||||
> **Important:** RequireJS [can **not** load CommonJS module as is](http://www.requirejs.org/docs/commonjs.html#intro), so be sure to require one of the built UMD files instead (i.e. `dist/Chart.js`, `dist/Chart.min.js`, etc.).
|
||||
Reference in New Issue
Block a user