<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<title>Chart.js Example</title>
<script src=
"https://cdn.jsdelivr.net/npm/chart.js">
</script>
<body>
<canvas id="myChart" width="400" height="200">
</canvas>
<script>
let ctx =
document.getElementById('myChart').getContext('2d');
let myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ['January',
'February',
'March',
'April',
'May'],
datasets: [{
label: 'Monthly Sales',
data: [12, 19, 3, 5, 2],
borderColor: 'rgba(75, 192, 192, 1)',
borderWidth: 3,
pointBackgroundColor: 'rgba(255, 99, 132, 1)',
pointBorderColor: 'rgba(255, 99, 132, 1)',
pointRadius: 6,
pointHoverRadius: 8,
}]
},
options: {
elements: {
point: {
pointStyle: 'triangle',
rotation: 45,
},
line: {
tension: 0.2,
}
},
scales: {
y: {
beginAtZero: true
}
}
}
}
);
</script>
</body>
</html>