Get started with Chart.js CDN
MIT licensed
Chart.js: Open-source library for creating dynamic, responsive web data visualizations.
Tags:- charts
Stable version
Copied!
How to start using Chart.js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with Chart.js CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script>
</head>
<body>
<div style="width: 800px; height: 400px; margin: 0 auto;">
<canvas id="myChart"></canvas>
</div>
<script>
const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
const data = [12, 19, 3, 5, 2, 3, 7];
const config = {
type: 'line',
data: {
labels,
datasets: [{
label: 'Sales',
data,
backgroundColor: 'rgba(75, 192, 193, 0.2)',
borderColor: 'rgba(75, 192, 193, 1)',
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
};
new Chart(document.getElementById('myChart'), config);
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.2.0
1.0.0-beta
1.0.1
1.0.1-beta
1.0.1-beta.2
1.0.1-beta.3
1.0.1-beta.4
1.0.2
1.1.0
1.1.1
2.0-alpha
2.0.0
2.0.0-alpha2
2.0.0-alpha3
2.0.0-alpha4
2.0.0-beta
2.0.0-beta1
2.0.0-beta2
2.0.1
2.0.2
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
2.1.6
2.2.0
2.2.0-rc.1
2.2.0-rc.2
2.2.1
2.2.2
2.3.0
2.3.0-rc.1
2.4.0
2.5.0
2.6.0
2.7.0
2.7.1
2.7.2
2.7.3
2.8.0
2.8.0-rc.1
2.9.0
2.9.1
2.9.2
2.9.3
2.9.4
3.0.0
3.0.0-alpha
3.0.0-alpha.2
3.0.0-beta
3.0.0-beta.10
3.0.0-beta.11
3.0.0-beta.12
3.0.0-beta.13
3.0.0-beta.14
3.0.0-beta.2
3.0.0-beta.3
3.0.0-beta.4
3.0.0-beta.5
3.0.0-beta.6
3.0.0-beta.7
3.0.0-beta.8
3.0.0-beta.9
3.0.0-rc
3.0.0-rc.2
3.0.0-rc.3
3.0.0-rc.4
3.0.0-rc.5
3.0.0-rc.6
3.0.0-rc.7
3.0.1
3.0.2
3.1.0
3.1.1
3.2.0
3.2.1
3.3.0
3.3.1
3.3.2
3.4.0
3.4.1
3.5.0
3.5.1
3.6.0
3.6.1
3.6.2
3.7.0
3.7.1
3.8.0
3.8.1
3.8.2
3.9.0
3.9.1
4.0.0-alpha.2
4.0.0-alpha.3
4.0.0-release
4.0.1
4.1.0
4.1.1
4.1.2
4.2.0
4.2.1
4.3.0
4.3.1
4.3.2
4.3.3
4.4.0
*** 4.4.1