c3
:bar_chart: A D3-based reusable chart library
A JavaScript charting library built on top of D3.js that lets you create interactive, reusable SVG charts with a simple configuration API, no deep D3 knowledge required.
C3 is a JavaScript library for creating interactive charts in web applications. It is built on top of D3.js, which is a lower-level library for drawing data-driven graphics using SVG (the vector graphic format that browsers can render natively). D3.js gives you a great deal of control but requires writing a lot of code to produce even basic charts. C3 sits on top of it to provide a simpler interface: you supply your data and a few configuration options, and C3 handles the drawing.
The library is designed to be reusable, meaning you can drop it into different web projects without rewriting chart logic each time. Charts produced by C3 are interactive by default, allowing users to hover over data points, toggle series on and off, and see tooltips. Because it outputs SVG, the charts scale cleanly at any screen size.
C3 supports common chart types and can be configured through a JavaScript API. A full reference, getting-started guide, and examples are available on the project's website. Additional sample files are included in the repository itself and can be viewed locally by running a simple development server.
The library depends on D3.js version 5 or higher, which must be included separately. Installation is available through npm, the standard JavaScript package registry, or via a CDN (a delivery network that hosts the file so you can link to it directly from HTML).
Community support is handled through a Google Group rather than the issue tracker, which is reserved for confirmed bugs and feature requests. The project is open source under the MIT license. The README is brief, and the main documentation lives on the project's external website.
Where it fits
- Add interactive line, bar, or pie charts to a web page with just a few lines of JavaScript configuration.
- Build a reusable chart component for a dashboard where users can hover over data points and toggle series on and off.
- Render data visualizations that scale cleanly to any screen size using SVG without image quality loss.