Index: charts.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/charts/charts.module,v
retrieving revision 1.28
diff -u -p -r1.28 charts.module
--- charts.module	13 May 2009 17:55:25 -0000	1.28
+++ charts.module	26 Oct 2009 10:13:48 -0000
@@ -49,6 +49,10 @@ function charts_menu() {
     'page arguments'  => array('_charts_settings_page'),
     'title'           => 'Charts'
   );
+  $items['admin/settings/charts/all'] = array(
+    'title' => 'All',
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+  );
   return $items;
 }
 
Index: google_charts/google_charts.admin.inc
===================================================================
RCS file: google_charts/google_charts.admin.inc
diff -N google_charts/google_charts.admin.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ google_charts/google_charts.admin.inc	26 Oct 2009 10:13:48 -0000
@@ -0,0 +1,68 @@
+<?php
+// $Id$
+/**
+ * @file
+ * Settings function for Google charts module.
+ */
+ 
+ 
+ /**
+ * Module settings page. Users can set the default layout
+ * of their charts.
+ *
+ * @ingroup form
+ */
+function _google_charts_settings_page() {
+  module_load_include('inc', 'google_charts');
+  $default = _google_charts_settings();
+  
+  $form = array();
+  
+  $form['legend'] = array(
+    '#default_value'  => $default['#legend'],
+    '#description'    => t('Enable legends'),
+    '#type'           => 'checkbox',
+    '#title'          => t('Legend'),
+  );
+  
+  $form['value_attributes'] = array(
+    '#default_value'  => $default['#value_attributes'],
+    '#description'    => t('Enable value attributes'),
+    '#type'           => 'checkbox',
+    '#title'          => t('Value attributes'),
+  );
+
+  $form['submit'] = array(
+    '#type'           => 'submit',
+    '#value'          => t('Save settings'),
+  );
+
+  return $form;
+}
+
+/**
+ * Module settings page. Users can set the default layout
+ * of their charts.
+ *
+ * @ingroup form
+ */
+function _google_charts_settings_page_submit(&$form, &$form_state) {
+  $settings = $form_state['values'];
+
+  // Discart all form values non related to charts
+  unset($settings['submit']);
+  unset($settings['form_id']);
+  unset($settings['form_build_id']);
+  unset($settings['form_token']);
+  unset($settings['op']);
+
+  // Include a # sign in all attributes, because it will make the
+  // merge between the chart data and the defaults easier on every
+  // chart display.
+  foreach ($settings as $index => $value) {
+    $default['#'. $index] = $value;
+  }
+
+  // Save the data into database
+  variable_set('google_charts_settings', $default);
+}
\ No newline at end of file
Index: google_charts/google_charts.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/charts/google_charts/google_charts.inc,v
retrieving revision 1.18
diff -u -p -r1.18 google_charts.inc
--- google_charts/google_charts.inc	15 May 2009 04:48:24 -0000	1.18
+++ google_charts/google_charts.inc	26 Oct 2009 10:13:48 -0000
@@ -6,15 +6,36 @@
  * Use Google Charts on your site.
  */
 
+/**
+ * Module settings page. Users can set the default layout
+ * of their charts.
+ *
+ * @ingroup form
+ */
+function _google_charts_settings() {
+  // Get the previously saved data from Data Base
+  static $default = array();
+
+  if (empty($default)) {
+    $default = variable_get('google_charts_settings', array());
+ 
+    // Legend and value attributes
+    $default['#legend']  = empty($default['#legend'])  ? 0 : $default['#legend'];
+    $default['#value_attributes']  = empty($default['#value_attributes'])  ? 0 : $default['#value_attributes'];
+  }
+  return $default;
+}
+
 function _google_charts($type) {
+  $default = variable_get('google_charts_settings', array());
   $types = array(
-    'line2D'  => array('legend' => TRUE, 'typecode' => 'lc', 'value_attributes' => FALSE),
-    'hbar2D'  => array('legend' => TRUE, 'typecode' => 'bhg', 'value_attributes' => FALSE),
-    'vbar2D'  => array('legend' => TRUE, 'typecode' => 'bvg', 'value_attributes' => FALSE),
-    'pie2D'   => array('legend' => FALSE, 'typecode' => 'p', 'value_attributes' => TRUE),
-    'pie3D'   => array('legend' => FALSE, 'typecode' => 'p3', 'value_attributes' => TRUE),
-    'venn'    => array('legend' => TRUE, 'typecode' => 'v', 'value_attributes' => FALSE),
-    'scatter' => array('legend' => FALSE, 'typecode' => 's', 'value_attributes' => FALSE),
+    'line2D'  => array('legend' => $default['#legend'], 'typecode' => 'lc', 'value_attributes' => $default['value_attributes']),
+    'hbar2D'  => array('legend' => $default['#legend'], 'typecode' => 'bhg', 'value_attributes' => $default['value_attributes']),
+    'vbar2D'  => array('legend' => $default['#legend'], 'typecode' => 'bvg', 'value_attributes' => $default['value_attributes']),
+    'pie2D'   => array('legend' => $default['#legend'], 'typecode' => 'p', 'value_attributes' => $default['value_attributes']),
+    'pie3D'   => array('legend' => $default['#legend'], 'typecode' => 'p3', 'value_attributes' => $default['value_attributes']),
+    'venn'    => array('legend' => $default['#legend'], 'typecode' => 'v', 'value_attributes' => $default['value_attributes']),
+    'scatter' => array('legend' => $default['#legend'], 'typecode' => 's', 'value_attributes' => $default['value_attributes']),
   );
   return $types[$type];
 }
@@ -103,7 +124,8 @@ function _google_charts_data_codingsimpl
  * @param &$data
  *   Array. The
  */
-function _google_charts_render(&$data) {
+function _google_charts_render(&$data) { 
+     
   $chart = array();
   if ($message = _google_charts_chart($chart, $data)) {
     return $message;
Index: google_charts/google_charts.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/charts/google_charts/google_charts.module,v
retrieving revision 1.16
diff -u -p -r1.16 google_charts.module
--- google_charts/google_charts.module	12 May 2009 22:54:50 -0000	1.16
+++ google_charts/google_charts.module	26 Oct 2009 10:13:48 -0000
@@ -9,6 +9,29 @@
  */
 
 /**
+ * Implementation of hook_menu().
+ */
+function google_charts_menu() {
+  $items['admin/settings/charts/google_charts'] = array(
+    'access arguments'  => array('set default settings for Google charts'),
+    'description'     => 'Set the default behaviour and look of your Google charts',
+    'file'            => 'google_charts.admin.inc',
+    'page callback'   => 'drupal_get_form',
+    'page arguments'  => array('_google_charts_settings_page'),
+    'title'           => 'Google charts',
+    'type'            => MENU_LOCAL_TASK,
+  );
+  return $items;
+}
+
+/**
+ * Implementation of hook_perm().
+ */
+function google_charts_perm() {
+  return array('set default settings for Google charts');
+}
+
+/**
  * Immplementation of hook_charts_info().
  *
  * Its a Charts module hook. It defines almost all aspects
