Index: views_plugin_style_chart.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_charts/views_plugin_style_chart.inc,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 views_plugin_style_chart.inc
--- views_plugin_style_chart.inc	12 Jan 2010 21:43:57 -0000	1.1.2.4
+++ views_plugin_style_chart.inc	2 Jun 2010 08:22:30 -0000
@@ -26,8 +26,6 @@
   function options_form(&$form, &$form_state) {
     parent::options_form($form, $form_state);
     
-    unset( $form['grouping']);    
-    
     $curr_disp = $this->view->current_display;
     $views_fields = $this->_get_fields();
     
@@ -132,16 +130,28 @@
 
   }
   
+  /**
+   * Render the display in this style.
+   */
   function render() {
+    // Group the rows according to the grouping field, if specified.
+    $sets = $this->render_grouping($this->view->result, $this->options['grouping']);
+
+    $output = '';
+    foreach ($sets as $title => $rows) {
+      $output .= $this->_render($rows, $title);
+    }
+    unset($this->view->row_index);
+    return $output;
+  }
 
-    $db_rows = $this->view->result;
+  function _render($rows, $title) {
     $canvas = chart_graphs_get_graph($this->options['engine']);
     
-    $cgp_data = $this->_transform_data();
+    $cgp_data = $this->_transform_data($rows);
     $canvas->set_data($cgp_data->rows, $cgp_data->x_labels);
     
     $curr_disp = $this->view->current_display;
-    $title = $this->view->display[$curr_disp]->display_title;
     $canvas->title = $title;
     $canvas->type = $this->options['type'][$this->options['engine']];
     $canvas->y_legend = $this->options['y_legend'];
@@ -167,10 +177,7 @@
   
   /** Transform data from Views-centric representation
   * into standard charts_and_graphs input format **/
-  function _transform_data() {
-    
-    $db_rows = $this->view->result;      
-    
+  function _transform_data($db_rows) {
     $series_column_names = $this->options['views_charts_series_fields'];
     $x_label_column = $this->options['views_charts_x_labels'];      
 
@@ -229,8 +236,6 @@
     $avail_fields = array();
     if (is_array($handlers)) {
       foreach ($handlers as $field => $handler) {
-        if ($field == 'views_sql_groupedfields' ) continue; //skip the groupby utility field
-  
           $field_alias = $handler->options['table'] . '_' . $handler->options['field'];
           $relationship = '';
   
