Skip to content

Commit

Permalink
improved graph appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhiscoding committed Jan 27, 2024
1 parent eea489a commit da4e83c
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function makegraph(arr){
document.querySelector(".bargraph").appendChild(bargraph);
bargraph.innerHTML = `
<h2>Followers</h2>
<canvas id="myBarChart" width="100px" height="50px"></canvas>`;
<canvas id="myBarChart" width="50px" height="25px"></canvas>`;
var ctx = document.getElementById('myBarChart').getContext('2d');
var myBarChart = new Chart(ctx, {
type: 'bar',
Expand All @@ -334,29 +334,24 @@ function makegraph(arr){
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
},
plugins: {
legend: {
display: true,
labels: {
fontSize: 14 // Adjust the font size of the legend
}
}
},
scales: {
x: {
ticks: {
fontSize: 12 // Adjust the font size of the x-axis labels
}
color: '#9cd8fe', // X-axis label color
fontSize: 30 // X-axis label font size
},
grid: {
color: '#9cd8fe' // X-axis grid line color
}
},
y: {
ticks: {
fontSize: 12 // Adjust the font size of the y-axis labels
}
color: '#9cd8fe', // Y-axis label color
fontSize: 30 // Y-axis label font size
},
grid: {
color: '#9cd8fe' // X-axis grid line color
}
}
}
}
Expand Down

0 comments on commit da4e83c

Please sign in to comment.