What are the available options for using the D3.js library in Drupal for creating data visualizations?

D3.js (Data-Driven Documents) appears to be a charting engine with an ever growing popularity. So I wonder how to somehow use D3.JS as a charting engine.

up vote 6 down vote accepted

There are at least 3 contributed modules which may help to use the D3.js library (open source, released under the BSD license) in a Drupal 7 site:

  • Charts and Graphs:

    Charts and Graphs is an API for developers. It can be extended by third-party modules that want to add their own charting implementations. It does nothing by itself. It should only be installed if some other module requires it.

  • D3 (Alfa release only):

    creates visualizations as libraries (alpha version only) which allows one to add/remove visualizations, share them between modules, and integrate them with (for example: Views) through library .info files.

    The Basic module configuration presentation provides a short intro about how to use the module in combination with Views.

  • Forena

If you decide to not use any of these modules, it may help to get started with D3.js integration in Drupal by just looking at the code of these modules. Either to roll your own D3.js cookies via a custom module, or at least to get an idea of the required effort.

The D3.JS Tutorial is a great place for documentation about how to use this library.

  • Thanks for the question and answer :) I didn't know D3 before. – herci Sep 9 '15 at 13:42

The Drupal 8 version of Charts (disclosure, I'm a co-maintainer) supports three libraries:

  • C3.js (new as of D8).
  • Google Charts and Highcharts (both similar to what is already in D7, now also for D8).

Some more details about how C3.js relates to D3.js:

C3 is a D3-based reusable charting library, more details about it can be found at c3js.org.

The current (D8) version of Charts is already available on Github, which is about to be released on Drupal.Org as the Alfa1 version of Charts also, as part of the newly launched D8Charts initiative (which got launched on Mar 10, 2017).

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.