The attached patch adds the ability to choose "Geo Chart" as the chart type in Views, along with setting the region and displayMode options. I have been able to successfully use this patch to output a Geo Chart for Location-enabled nodes with Views.

Comments

jamix’s picture

StatusFileSize
new2.89 KB
johnkareoke’s picture

Thanks. Have tested this patch and it works.

I have made additions to broaden the use case to include lower level administrative areas such as States (US) and provinces in some countries, not just country level Geocharts. See attached screenshot and diff below.

diff --git a/sites/all/modules/google_chart_tools/google_chart_tools_views/views/google_chart_tools_views_plugin_style.inc b/sites/all/modules/google_chart_tools/google_chart_tools_views/views/google_chart_tools_views_plugin_style.inc
index 8404bb3..e01271c 100644
--- a/sites/all/modules/google_chart_tools/google_chart_tools_views/views/google_chart_tools_views_plugin_style.inc
+++ b/sites/all/modules/google_chart_tools/google_chart_tools_views/views/google_chart_tools_views_plugin_style.inc
@@ -25,6 +25,7 @@ class google_chart_tools_views_plugin_style extends views_plugin_style {
     $options['isstacked'] = array('default' => FALSE);
     $options['region'] = array('default' => '');
     $options['displaymode'] = array('default' => '');
+    $options['resolution'] = array('default' => '');
     $options['pointsize'] = array('default' => 0);
     $options['colors'] = array('default' => '');
 
@@ -113,6 +114,16 @@ class google_chart_tools_views_plugin_style extends views_plugin_style {
       '#size' => 10,
       '#default_value' => $this->options['displaymode'],
     );
+    $form['resolution'] = array(
+      '#type' => 'select',
+      '#title' => t('Resolution'),
+      '#description' => t('The resolution at which to draw borders. Provinces work for U.S. states and some other country regions.'),
+      '#options' => array(
+      'countries' => 'countries',
+      'provinces' => 'provinces',
+      ),
+      '#default_value' => $this->options['resolution'],
+    );
     $form['pointsize'] = array(
       '#type' => 'textfield',
       '#title' => t('Data point size'),
@@ -209,6 +220,7 @@ class google_chart_tools_views_plugin_style extends views_plugin_style {
         'isStacked' => $this->options['isstacked'],
         'region' => $this->options['region'],
         'displayMode' => $this->options['displaymode'],
+        'resolution' => $this->options['resolution'],
         'pointSize' => $this->options['pointsize'],  
         'colors' => $this->options['colors'] ? explode(",", str_replace(' ', '', $this->options['colors'])) : NULL,
         'title' => $this->options['title'],

scrrenshot

johnkareoke’s picture

StatusFileSize
new16.29 KB
pkil’s picture

Can confirm the above patch with @johnkareoke additional changes works perfectly!