<!DOCTYPE html>
<html>
<head>
<title>Chart JS Bar Chart </title>
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js">
</script>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.1.2/chart.umd.js">
</script>
</head>
<body>
<div>
<h1 style="color:green">GeeksforGeeks</h1>
<h3>Chart JS Bar Chart </h3>
<div>
<canvas id="barChartID"></canvas>
</div>
</div>
<script>
// Bar chart
new Chart($("#barChartID"), {
type: 'bar',
options: {
legend: { display: true },
indexAxis: 'x',
title: {
display: true,
text: 'Bar Chart using ChartJS library'
}
},
data: {
labels: ["C++", "Java", "Blockchain", "PHP", "Python","HTML"],
datasets: [
{
label: "Technology Learned by Students",
backgroundColor: ["#FFC0CB", "#0000FF",
"#00FFFF", "#FFA500", "#FF7F50","#FF0000"],
data: [234, 356, 819, 732, 213, 542]
}
]
}
});
</script>
</body>
</html>