Drupal – Radar/Polar charts with Chart API Module

I have been developing a web application for one of our clients using drupal, it’s a dashboard type data visualisation system that consumes and displays data over an intranet from their software systems.  I have been using google charts with great success.


The Chart API module for drupal is very nice, it lets you quite easily incorporate google charts into your web site or application without having to get into the details of the google chart API itself, and the charts themselves look great – just the kind of thing to cheer up a busy software developer.  However it deosn’t seem to support Radar or Polar charts.  There is no mention of them in the documentation, no example on the examples page.  There is also no symbol such as ‘CHART_TYPE_RADAR’ defined in the module as there is for the other chart types, for example ‘CHART_TYPE_LINE’ defined for line charts.


So is it possible to plot radar charts using the Chart API module?  I consulted the google chart api and found that the radar chart type is donated as ‘r’, so I tried creating a simple chart and just set it’s type to ‘r’ (rather than say CHART_TYPE_LINE) and it worked just fine!


$chart = array(
'#chart_id' => 'sink_radar',
'#title' => chart_title(t('Failures by Sink'), '001334', 15),
'#type' => 'r',
'#size' => chart_size(400, 240),
$chart['#data'][] = array(20, 30, 15, 70, 90, 20);
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] =
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] =
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] =
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] =
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] =
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] =
echo chart_render($chart);

 This code yileds a chart like this:


Radar Chart

Deploying Microsoft Report Viewer with ASP on a Hosted Site

The Microsoft Report Viewer is a handy way of producing reports without having to enter the Crystal Reports Quagmire, however deploying it within an ASP application to a Hosted environment can be quite involved as it may not be installed on your host system and it will usually not be possible to run the installer.


Instead doing the following worked for us:


Copy the following dlls to your project’s bin directory:








The first three will be easy to find on your development system – do a search, the last might only exist in you development system’s GAC, to get easy access to this use the subst command as follows to map it to a virtual drive:


Subst b: %windir%\assembly


This will map it to b:


Once the dlls have been copied into the bin folder, delete the existing GAC reference from your project to ‘Microsoft.ReportViewer.WebForms’, and add it again, this time by browsing to ‘Microsoft.ReportViewer.WebForms.dll’ in your bin folder.


Now when you publish… your app to your hosted site, the report viewer should work OK.