You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script>
// Get the canvas element
const canvas = document.getElementById('skillChart');
const ctx = canvas.getContext('2d');
// Define the skill levels
const skills = [
{ name: 'Python', level: 90 },
{ name: 'MATLAB', level: 80 },
{ name: 'C/C++', level: 70 },
// Add more skills as needed
];
// Set the bar height and spacing
const barHeight = 20;
const barSpacing = 5;
// Set the starting position for the first bar
let y = 10;
// Loop through the skills and draw the bars
skills.forEach((skill) => {
const barWidth = skill.level * 1; // Adjust the scale as needed
// Draw the bar
ctx.fillStyle = 'green'; // Set the bar color
ctx.fillRect(0, y, barWidth, barHeight);
// Draw the skill name
ctx.fillStyle = 'black'; // Set the text color
ctx.font = '10px Arial'; // Set the font
ctx.fillText(skill.name, barWidth + 10, y + barHeight - 5);
// Update the y position for the next bar
y += barHeight + barSpacing;
});
</script>