Chart.js
is a lightweight JavaScript library that makes drawing responsive charts as simple as passing data and configuration objects. Instead of manually calculating pixel coordinates and drawing SVG paths, you define labels, datasets, and let Chart.js handle the rendering, scaling, animations, and tooltips.
In this challenge you will create a
line chart
that visualizes monthly visitor statistics. You will:
Add a
<canvas>
element where Chart.js will draw the graph.
Write a
new Chart()
constructor call with a configuration object containing labels, datasets, and style options.
Enable
responsive
resizing so the chart shrinks and grows with its container.
Configure
tooltips
that show exact values when hovering data points.
Customize the line color, fill, point styles, and grid lines.
Chart.js is used by thousands of open-source dashboards, admin panels, and analytics tools. Mastering its configuration API lets you build bar, line, pie, radar, and bubble charts with the same consistent syntax — so this single challenge unlocks all the other Chart.js challenges on CodeChallenge.