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 -r1.18 google_charts.inc
--- google_charts/google_charts.inc	15 May 2009 04:48:24 -0000	1.18
+++ google_charts/google_charts.inc	8 Feb 2010 16:38:54 -0000
@@ -64,6 +64,38 @@
     $chart[] = 'chf=bg,s,'. substr($data['#color']['background'], 1);
   }
 
+  // Chart axis.
+  if(isset($data['#axis'])) {
+    $axis = array();
+    $labels = array();
+    $positions = array();
+    $range = array();
+    $i = 0;
+    foreach($data['#axis'] as $key => $value) {
+      $axis[] = $key;
+      if(isset($value['#labels'])) {
+        $labels[] = $i . ':|' .implode('|', $value['#labels']);
+      }
+      if(isset($value['#positions'])) {
+        $positions[] = $i . ',' . implode(',', $value['#positions']);
+      }
+      if(isset($value['#range'])) {
+        $range[] = $i . ',' . implode(',', $value['#range']);
+      }
+      $i++;
+    }
+    $chart[] = 'chxt='.implode(',', $axis);
+    if(count($labels)) {
+      $chart[] = 'chxl='.implode('|', $labels);
+    }
+    if(count($positions)) {
+      $chart[] = 'chxp='.implode('|', $positions);
+    }
+    if(count($range)) {
+      $chart[] = 'chxr='.implode('|', $range);
+    }
+  }
+  
   return;
 }
 
@@ -82,17 +114,11 @@
  * @return
  *   String. The string presentation of series data
  */
-function _google_charts_data_codingsimple($value, $max) {
+function _google_charts_data_codingsimple($value, $max, $min = 0) {
   // Set the list of characters and the size of the list
   $simple = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
   $simple_len = drupal_strlen($simple) - 1;
-
-  if ($value >= 0) {
-    return $simple[round($simple_len * $value / $max)];
-  }
-  else {
-    return  '_';
-  }
+  return $simple[round($simple_len * ($value - $min) / ($max - $min))];
 }
 
 /**
@@ -137,6 +163,8 @@
   $chart_data = '';
 
   $value_labels = array();
+  $set_value_labels = FALSE;
+  $minmax = array();
 
   // For each chart value, encode it
   // Note: Underscore represents a missing value
@@ -150,7 +178,14 @@
     $series_data = _charts_series_values($data[$series]);
 
     // Get the highest value on the series, to be a reference point
-    $max = max($series_data);
+    if(!empty($data[$series]['#minmax'])) {
+      $max = $data[$series]['#minmax'][1]; /// - $data[$series]['#minmax'][0];
+      $min = $data[$series]['#minmax'][0]; /// - $data[$series]['#minmax'][0];
+    }
+    else {
+      $max = max($series_data);
+      $min = 0;
+    }
 
     // Value labels: temporary array.
     $value_labels_temp = array();
@@ -158,10 +193,13 @@
     // For each series of data, scan it
     foreach (array_keys($series_data) as $value) {
       $svalue = &$data[$series][$value];
-      $chart_data .= _google_charts_data_codingsimple($series_data[$value], $max);
+      $chart_data .= _google_charts_data_codingsimple($series_data[$value], $max, $min);
 
       $value_labels_temp[] = empty($svalue['#label']) ? NULL : $svalue['#label'];
-
+      if(!empty($svalue['#label'])) {
+        $set_value_labels = TRUE;
+      }
+      
       // Get the highlight points
       if (!empty($svalue['#highlight'])
           or ($data['#type'] == 'scatter' and ($series % 2 == 0))) {
@@ -190,6 +228,9 @@
 
       // Series colors
       $colors[] = empty($data[$series]['#color']) ? NULL : substr($data[$series]['#color'], 1);
+      
+      // Series minmax
+      $minmax[] = $min . ',' . $max;
     }
   }
 
@@ -207,11 +248,10 @@
   }
 
   // Insert values labels
-  if (!empty($value_labels)) {
+  if ($set_value_labels) {
     $chart[] = 'chl='. implode('|', $value_labels);
   }
 
-
   // Insert multiple series tag
   if ($options['legend'] and !empty($legends)) {
     $chart[] = 'chdl='. implode('|', $legends);
@@ -221,6 +261,10 @@
   if (!empty($highlight)) {
     $chart[] = 'chm='. implode('|', $highlight);
   }
+  
+  if(!empty($minmax)) {
+    $chart[] = 'chds=' . implode(',', $minmax);
+  }
 
   return;
 }
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .project	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>charts</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.dltk.core.scriptbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.php.core.PHPNature</nature>
+	</natures>
+</projectDescription>
