General Notes about Views ChartingThere are some special caveats to getting this working with Views. None of the flash charts can be viewed in the Views preview pane, you have to save the view and look at the page or block to see the effect. This was true for every module that provided a flash alternative. You can chart the individual values in Views, but most of the time you will want to chart aggregated totals, the COUNT or SUM or AVG of your values, so finding a way to do aggregations is important. This is handled differently by different modules. Charts provides a way to do a COUNT of values, FusionCharts is trying to incorporate aggregation settings, and add on modules like Views Calc or Views GroupBy provide other ways to aggregate totals. There is work going on in Views to add more ways to get aggregated totals and that will change the way this works in the future. When you use aggregations you have to be careful not to add any extra fields, filters, sorts, or arguments to the view or you will screw up the logic that creates the query when Views tries to aggregate that new field. You may have to look at the query created to be able to tell if it is doing the right thing, most useful for people who know how to interpret SQL code. Watch the values for 'pager' and 'number of items'. The number of items defaults to 10, so unless you change it you will not be viewing a chart of all your data, only the first 10 items. It's a good idea to first create a simple view like a table of your data to be sure your view is set up to produce logical results. Following are more details about each of the modules I evaluated.
ChartsUrl: http://drupal.org/project/charts Drupal dependencies: Open Flash Charts depends on the Open Flash API. Third party code: Open Flash Charts and Fusion Charts require add-ins. Maintainer(s): brmassa # Downloads week of Apr 4: 647 Date added: March 10, 2008 Date lasted updated: November 13, 2008 Latest version: 6.x-1.0-alpha5 Views integration: Yes Demonstration/Tutorial: http://drupal.org/node/233753 This module provides a single integration for all three charting methods: Google Charts, Open Flash Charts, and Fusion Charts. Because of that it implements a basic set of functions and does not support special features of any of them. For instance there is no way to use the 'map' chart in Google charts or use features like Google's setting to automatically fit the bars in a bar graph to the space available. There is no documentation about where to put the external files for Open Flash or Fusion Charts and there were numerous issues reporting that no one else was able to get them to work. I finally figured out that using Open Flash in Charts introduces an undocumented dependency on the Open Flash Chart API (not to be confused with Open Flash Chart 2 API) but it does not check if the module is installed before trying to use it, causing potentially fatal errors if not set up correctly. Open Flash Chart API in turn requires version 1, not version 2, of Open Flash, which is fairly well buried on the Open Flash site. Once I got the right files and modules enabled, the Open Flash charts worked as well as the Google charts. I was never able to find any way to get Fusion Charts working. The Views integration only works on simple data sets or counts (the configuration says 'Display sum of different values', but the code is counting the values, not summing them). You add one field to the view and either display its values or the aggregated counts of its values. It would take custom code or another module to do more than that. The Views Calc module provides an additional Views chart style that will do SUM, COUNT, AVG, MIN, or MAX aggregations of the data. The Views GroupBy module adds a COUNT aggregation field that can be charted. This package also includes an optional 'System Charting' module that will create a charts display of some system statistics in the administration 'Reports' section. This appears to be the most widely-used module, it does have Views integration, and it is used by other modules that extend the core code.
ChartUrl: http://drupal.org/project/chart Drupal dependencies: Third party code: None, works with Google Charts Maintainer(s): tjholowaychuk, chrislynch # Downloads week of Apr 4: 114 Date added: January 3, 2008 Date lasted updated: September 11, 2008 Latest version: 6.x-1.2 Views integration: No Demonstration/Tutorial: http://code.google.com/p/drupal-chart-api/wiki/Examples This module predates the other Drupal charts modules and works only with Google charts. It overcomes the problem the Charts module has in that it can fully implement the Google API since it's not trying work with other charting platforms. You can do Maps and other special Google charts. However, there is no Views integration for this module, so for all practical purposes, the only way to use it is as an API for your custom code or for system charts. The provided system charts are nice:
FusionChartsUrl: http://drupal.org/project/fusioncharts Drupal dependencies: Colorpicker Third party code: Fusion Charts Maintainer(s): aaron1234nz # Downloads week of Apr 4: 107 Date added: July 26, 2008 Date lasted updated: March 14, 2009 Latest version: 6.x-1.x-dev Views integration: In progress Demonstration/Tutorial: http://sandbox.webtolife.org/fusioncharts/multi_series The module has a dependency on the Colorpicker module, which is clearly noted on the project page with a link to that project. The project page also provides an outline of what it does, which includes integration with Views, Webform, and CCK, and availability as an API. Much of the installation documentation is in an included README.txt file, which makes it clear how to set things up. The state of the Drupal 6 version is correctly noted as very early stage and not ready for production. The module includes charts in the administration 'Reports' section, like the following:
Open Flash Chart 2 APIUrl: http://drupal.org/project/ofc_api Drupal dependencies: PHP 5.2+ Third party code: Open Flash 2 Maintainer(s): kong # Downloads week of Apr 4: 26 Date added: April 3, 2009 Date lasted updated: April 10, 2009 Latest version: 6.x-1.1 Views integration: No Demonstration/Tutorial: http://suksit.com/node/230/open-flash-chart-2-api-module-for-drupal, http://drupal.org/node/423020 This is an API for Open Flash 2 and does not do anything on its own, but is needed by other modules or used as an API.
Open Flash Chart APIUrl: http://drupal.org/project/open_flash_chart_api Drupal dependencies: None Third party code: Open Flash 1 Maintainer(s): redndahead # Downloads week of Apr 4: 265 Date added: November 16, 2007 Date lasted updated: January 13, 2009 Latest version: 6.x-2.10 Views integration: No This is an API for Open Flash 1 and does not do anything on its own, but is needed by other modules or used as an API.
Views Charts & Charts and GraphsUrl: http://drupal.org/project/charts_graphs http://drupal.org/project/views_charts Drupal dependencies: Views, SWFObject API Third party code: Open Flash 2, SWF Object Maintainer(s): irakli # Downloads week of Apr 4: 90 Date added: March 4, 2009 Date lasted updated: March 4, 2009 Latest version: 6.x-1.0-alpha1 Views integration: Yes Video: http://dc2009.drupalcon.org/session/business-analytics-drupal-views Charts and Graphs is the API, and Views Charts is the Views integration module that uses the API. The project page notes that you will want to use something like Views GroupBy to do meaningful charts, and clearly identifies its dependencies, with links to the project pages for each. It depends on the SWF Object API (not to be confused with SWF Object), which in turn requires that you download and include some of the SWF Object code (which has both a version 1 and a version 2, so you have to pick up the correct one, version 2). Charts and Graphs requires that you find and download Open Flash 2 and the instructions for doing that are buried in charts_graphs/apis/charts_openflash/INSTALL.txt. The module creates no automatic system charts, just provides Views integration, but you could create your own system charts using Views. Once I got all the right modules installed and all the right files set up I was able to create simple charts fairly well. The project page recommends using Views GroupBy to do aggregations but that only works for COUNT queries, plus I was not able to get it working correctly for anything other than basic node fields like title and type. CCK fields would not work at all, they added additional fields to the query that kept it from doing the right grouping. This is a brand new project, so I assume they will iron the wrinkles out, but as it stands right now I wasn't able to get useful results for anything that required aggregation.
Update!When irakli reported below that CCK fields ought to work, I went back to file an issue illustrating my problems and found there were significant updates to several of the modules between the time I tested them (April 15) and the time this report was published (April 23), so I re-ran all my tests using the latest code. This time I was able to aggregate and chart CCK fields with no problems. I also found that they have removed some of the dependencies and incorporated some of the external files, making it easier to set up. So I would say this alternative is much further along than it was when I first ran my tests. Since these fixes were made before the date of this report, I wanted to clarify this information.
Statistics ProUrl: http://drupal.org/project/statspro Drupal dependencies: Statistics (core), Charts Third party code: Whatever Charts requires Maintainer(s): mr3dblond # Downloads week of Apr 4: 107 Date added: December 31, 2008 Date lasted updated: January 2, 2009 Latest version: 6.x-1.x-dev Views integration: Yes This module depends on the Charts module, so has all the same installation and set up issues. It will use whatever charting framework you set up for Charts, either Google Charts or Open Flash Charts. The project page says it has Drush support, but I didn't investigate what that meant. This package is primarily designed to provide charting for administrative information. Once set up it creates an impressive collection of system information tables and charts. All the tables are Views tables so they can be adjusted, although there are few changes you can make because they only use custom 'Statistics Pro' fields and filters, not all the fields and filters you might be expecting to see. However, as an administration tool, this is pretty impressive.