Chart.js/docs/getting-started/integration.md
Evert Timberg 3e94b9431a Update the docs structure/content to use GitBook (#3751)
Update the docs structure/content to use GitBook
2017-03-20 20:36:54 -04:00

640 B

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

import Chart from 'chart.js'
var myChart = new Chart(ctx, {...})

Script Tag

<script src="path/to/Chartjs/dist/Chart.js"></script>
<script>
var myChart = new Chart(ctx, {...})
</script>

Common JS

var Chart = require('chart.js')
var myChart = new Chart(ctx, {...})

Require JS

require(['path/to/Chartjs/src/chartjs.js'], function(Chart){
    var myChart = new Chart(ctx, {...})
})