What it does
Chart.js is a JavaScript charting library for presenting structured data in a web page. A chart is configured from a canvas element, a chart type, labels, datasets and options. The library provides common visualizations such as bars and lines without requiring a separate charting service. It draws into a canvas that the application supplies, so developers remain responsible for the data, page layout and accessible text alternatives.
For a small report, place a <canvas> in the page, load Chart.js from npm or a CDN, and instantiate a chart with a type and dataset. The official starter example uses a bar chart with category labels and numeric values; changing type and the dataset shape produces other supported chart styles.
new Chart(document.getElementById('myChart'), {
type: 'bar',
data: {
labels: ['Q1', 'Q2'],
datasets: [{ label: 'Tickets', data: [12, 19] }]
}
});
Give the canvas a responsive container and decide what the chart should communicate before choosing axes or color. Chart.js does not fetch or clean the underlying data. Its accessibility guide also makes a key limitation explicit: canvas content is not exposed to screen readers by itself. Add a useful accessible name and fallback content or another text representation of the data.
Strengths
- A chart can be configured from a canvas, labels and datasets, with installation options for npm, CDNs and front-end integrations.
- The documentation includes common chart types, axis configuration and responsive layout guidance.
Watch out for
- Canvas output is not accessible to screen readers without ARIA attributes, fallback content or another text representation.
- The application must provide and prepare chart data; Chart.js is a rendering library, not a data source.
Best for
- Adding common charts to JavaScript dashboards and reports.
- Rendering charts from data already available in a browser application.
Sources
- Chart.js getting started guide (Oct 26, 2026)
- Chart.js accessibility guidance (Oct 26, 2026)
- Chart.js official repository (Oct 26, 2026)
- Chart.js MIT license (Oct 26, 2026)
