mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +02:00
3e94b9431a
Update the docs structure/content to use GitBook
34 lines
640 B
Markdown
34 lines
640 B
Markdown
# 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/src/chartjs.js'], function(Chart){
|
|
var myChart = new Chart(ctx, {...})
|
|
})
|
|
``` |