Closed (fixed)
Project:
Google Chart Tools: Image Charts
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2008 at 15:37 UTC
Updated:
1 May 2008 at 10:51 UTC
You can now roll nice maps with the google Chart api (http://code.google.com/apis/chart/#maps), and I've attached a patch that adds this to the Drupal chart API.
Arguments are #countries (an array of ISO country codes (ISO 3166-1 codes listed on http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country...)) and #georange, a string being "africa, asia, europe, middle_east, south_america, usa and world. Chart type is 'CHART_TYPE_MAP'.
To include a chart use the following code. A views plugin for this would be really useful ;) Oh and maybe an input filter as well.
$chart = array(
'#chart_id' => 'test_chart',
'#type' => CHART_TYPE_MAP, //Map Type
'#countries' => array(MG,KE,TN), //Array of ISO country codes (2 letter codes)
'#georange' => africa, //Geographic Range of the Map - continent name or 'world'
'#data' => array(10,50,100), //Value affects intensity of colours which will be in the range defined by #data_colours second and third elements
'#data_colors' => array('ffffff', 'edf0d4', '13390a') //3 values for the colour (all other countries, start colour and end colour)
);
echo chart_render($chart);
creates this map of Africa with Madagascar, Kenya and Tunisia hilighted.
| Comment | File | Size | Author |
|---|---|---|---|
| chart.patch | 853 bytes | kehan |
Comments
Comment #1
tjholowaychuk commentedComment #2
kehan commentedThanks