<!DOCTYPE html>
<html>
<head>
<title>
ChartJS Title Configuration
</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>
<h1 style="color:green;">
GeeksforGeeks
</h1>
<h3 style="color:black;">
ChartJS Title Configuration
</h3>
<canvas id="myChart"
width="700"
height="300">
</canvas>
<script>
var ctx =
document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Python',
'JavaScript',
'Java',
'C++',
'HTML/CSS'],
datasets: [{
label:
'GeeksforGeeks Programming Languages Popularity',
data: [85, 78, 70, 65, 60],
backgroundColor: [
'rgba(255, 99, 132, 0.7)',
'rgba(54, 162, 235, 0.7)',
'rgba(255, 206, 86, 0.7)',
'rgba(75, 192, 192, 0.7)',
'rgba(153, 102, 255, 0.7)'
]
}]
},
options: {
plugins: {
title: {
display: true,
text: ['ChartJS Title Configuration',
'Title Configuration'],
align: 'center',
color: 'blue',
fullSize: false,
position: 'top',
font: {
size: 20,
weight: 'bold',
family: 'Arial',
style: 'italic'
},
padding: {
top: 20,
bottom: 10
}
}
}
}
});
</script>
</body>
</html>