/[drupal]/contributions/modules/chart/chart.module
ViewVC logotype

Diff of /contributions/modules/chart/chart.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.15, Tue Jul 14 02:45:33 2009 UTC revision 1.16, Wed Oct 21 04:23:09 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: chart.module,v 1.15 2009/07/14 02:45:33 boombatower Exp $
3  /**  /**
4   * @file   * @file
5   * Provides Google chart API integration.   * Provides Google chart API integration.
# Line 58  define('CHART_ALIGN_LEFT', -1); Line 58  define('CHART_ALIGN_LEFT', -1);
58  define('CHART_ALIGN_CENTER', 0);  define('CHART_ALIGN_CENTER', 0);
59  define('CHART_ALIGN_RIGHT',  1);  define('CHART_ALIGN_RIGHT',  1);
60    
61    /**
62     * Legend Position
63     */
64    define('CHART_LEGEND_BOTTOM',  'b');
65    define('CHART_LEGEND_TOP', 't');
66    define('CHART_LEGEND_BOTTOM_VERTICAL', 'bv');
67    define('CHART_LEGEND_TOP_VERTICAL', 'tv');
68    define('CHART_LEGEND_RIGHT', 'r');
69    define('CHART_LEGEND_LEFT', 'l');
70    
71  /*-----------------------------------------------------------------  /*-----------------------------------------------------------------
72   * Hook Implementations   * Hook Implementations
73   *------------------------------------------------------------------*/   *------------------------------------------------------------------*/
# Line 284  function chart_build($chart) { Line 294  function chart_build($chart) {
294    
295    $data['chd'] = 't:' . _chart_encode_data($chart['#data']);    $data['chd'] = 't:' . _chart_encode_data($chart['#data']);
296    
297    _chart_append('cht',  $chart['#type'],                    $data);    _chart_append('cht',   $chart['#type'],                    $data);
298    _chart_append('chs',  $chart['#size'],                    $data);    _chart_append('chs',   $chart['#size'],                    $data);
299    _chart_append('chtt', $chart['#title'],                   $data);    _chart_append('chtt',  $chart['#title'],                   $data);
300    _chart_append('chl',  $chart['#labels'],                  $data);    _chart_append('chl',   $chart['#labels'],                  $data);
301    _chart_append('chdl', $chart['#legends'],                 $data);    _chart_append('chdl',  $chart['#legends'],                 $data);
302    _chart_append('chls', $chart['#line_styles'],             $data);    _chart_append('chdlp', $chart['#legend_position'],         $data);
303    _chart_append('chg',  $chart['#grid_lines'],              $data);    _chart_append('chls',  $chart['#line_styles'],             $data);
304    _chart_append('chm',  $chart['#shape_markers'],           $data);    _chart_append('chg',   $chart['#grid_lines'],              $data);
305    _chart_append('chco', $chart['#data_colors'],             $data);    _chart_append('chm',   $chart['#shape_markers'],           $data);
306    _chart_append('chf',  $chart['#chart_fill'],              $data);    _chart_append('chco',  $chart['#data_colors'],             $data);
307    _chart_append('chxt', $chart['#mixed_axis_labels'],       $data);    _chart_append('chf',   $chart['#chart_fill'],              $data);
308    _chart_append('chxs', $chart['#mixed_axis_label_styles'], $data);    _chart_append('chxt',  $chart['#mixed_axis_labels'],       $data);
309    _chart_append('chbh', $chart['#bar_size'],                $data);    _chart_append('chxs',  $chart['#mixed_axis_label_styles'], $data);
310    _chart_append('chld', $chart['#countries'],               $data);    _chart_append('chbh',  $chart['#bar_size'],                $data);
311    _chart_append('chtm', $chart['#georange'],                $data);    _chart_append('chld',  $chart['#countries'],               $data);
312      _chart_append('chtm',  $chart['#georange'],                $data);
313    
314    $charts[$chart['#chart_id']] = drupal_query_string_encode($data);    $charts[$chart['#chart_id']] = drupal_query_string_encode($data);
315    
# Line 518  function _chart_append($attr, $value, &$ Line 529  function _chart_append($attr, $value, &$
529        $data[$attr] = implode('|', $value);        $data[$attr] = implode('|', $value);
530        break;        break;
531    
532        // Legend's position
533        case 'chdlp':
534          $data[$attr] = $value;
535          break;
536    
537      // Line styles      // Line styles
538      case 'chls':      case 'chls':
539        $styles = array();        $styles = array();

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.2