Views Charts implements a new View style: charts. With it the use can present view data as charts.

Dependencies

Views Charts depends on Charts and Graphs and Views.

The Views GroupBy module provides important functionality that greatly enhances Views Charts usage. Please consider installing it with Views Charts.

Usage

This usage instructions were shamelessly stolen from Views GroupBy project page:

  1. Create a new View
  2. Add following fields:
  3. Click on the "SQL Aggregation: Group By Fields" and configure its settings as follows:
  4. Add a filtering criteria for the node type if you need to.
  5. Add a page display to the view. Set the page path to views_charts_example_view

Test this view. You should get aggregated data per taxonomy term.

Lastly you only have to set the charting options:

  1. In Basic settings change the Style to Charts and click the Update button
  2. In the settings page choose:

That's it. Save the view. Views with Charts style can't be previewed. Open <http://www.example.org/views_charts_example_view> to see the chart.

Customizing charts

The presented charts can be customized through the hook_views_charts_graph_alter() hook.

hook_views_charts_graph_alter(&$canvas);
The hook_views_charts_graph_alter() hook is called just before actual chart draw. You can freely change $canvas to customize any chart property. To understand how to customize $canvas please see the Charts and Graphs module documentation.