dc.js
Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
A JavaScript library for building interactive data dashboards where clicking one chart automatically filters all the others, letting users explore data from multiple angles at the same time.
dc.js is a JavaScript library for building interactive dashboards where multiple charts are linked together. When you click to filter one chart, every other chart on the page updates automatically to reflect that selection. This kind of coordinated filtering is useful for exploring data from many angles at once, for example clicking a date range in a bar chart and seeing a pie chart and a scatter plot both update instantly to show only data from that period.
The library is built on top of two other JavaScript tools: crossfilter, which handles the fast in-browser data filtering, and d3.js, which handles the actual drawing of chart shapes. dc.js sits on top of both, providing ready-made chart types like bar charts, pie charts, line charts, and data tables that automatically wire into the crossfilter filtering system. You do not need to write the connection logic yourself.
Each chart in dc.js displays a summary of one dimension of your data, using position, size, or color to represent values. When a user brushes or clicks a chart to apply a filter, all other charts animate to their updated state. This animation is handled by d3.js underneath.
Installing dc.js can be done through npm with one command, or by loading it directly from a CDN link in a webpage. It depends on d3 version 4 or 5. For projects that still need to support Internet Explorer, version 3 of the library is available instead.
The project is open source under the Apache 2.0 license and has been available for many years. Support resources include a StackOverflow tag, a user group mailing list, and a wiki with frequently asked questions. The project links to a live example page and an annotated source walkthrough for getting started quickly.
Where it fits
- Build a sales dashboard where clicking a date range on a bar chart instantly filters a pie chart and data table to match.
- Create an interactive data exploration tool that lets non-technical users filter a dataset by clicking multiple charts simultaneously.
- Add coordinated filtering to an existing D3.js chart set so all charts update together when a user makes a selection.