ChartJs Documentation

Description

Simple HTML5 Charts using the canvas element

Initialization

Initialize the plugin by referencing the necessary files:

<script src="chart.min.js"></script>

DOM element

The component will bind to any existing DOM element.

<div class="chartjs">
    <canvas id="myChart" width="400" height="400"></canvas>
</div>

Charts Scripts

Basic usage may look something like this.


var myChart = new Chart({...})

// Using CommonJS
var Chart = require('src/chart.js')
var myChart = new Chart({...})

// ES6
import Chart from 'src/chart.js'
let myChart = new Chart({...})

// Using requirejs
require(['path/to/Chartjs'], function(Chart){
 var myChart = new Chart({...})
})