| 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. |
| 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 |
*------------------------------------------------------------------*/ |
*------------------------------------------------------------------*/ |
| 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 |
|
|
| 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(); |