Merge pull request #5132 from colemanw/css
[civicrm-core.git] / CRM / Utils / OpenFlashChart.php
index dbeef70de55b3d428322eff8ed6966fa3bd5f80a..63173bae52e50a2543f916a90a40acfd5b40c2d9 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -43,12 +43,20 @@ class CRM_Utils_OpenFlashChart {
   /**
    * Colours.
    * @var array
-   * @static
    */
   private static $_colours = array(
-    "#C3CC38", "#C8B935", "#CEA632", "#D3932F",
-    "#D9802C", "#FA6900", "#DC9B57", "#F78F01",
-    "#5AB56E", "#6F8069", "#C92200", "#EB6C5C",
+    "#C3CC38",
+    "#C8B935",
+    "#CEA632",
+    "#D3932F",
+    "#D9802C",
+    "#FA6900",
+    "#DC9B57",
+    "#F78F01",
+    "#5AB56E",
+    "#6F8069",
+    "#C92200",
+    "#EB6C5C",
   );
 
   /**
@@ -57,8 +65,8 @@ class CRM_Utils_OpenFlashChart {
    * @param array $params
    *   Assoc array of name/value pairs.
    *
-   * @return object $chart   object of open flash chart.
-   * @static
+   * @return object
+   *   $chart   object of open flash chart.
    */
   public static function &barChart(&$params) {
     $chart = NULL;
@@ -126,7 +134,7 @@ class CRM_Utils_OpenFlashChart {
     $xLabels = new x_axis_labels();
     // set_labels function requires xValues array of string or x_axis_label
     // so type casting array values to string values
-    array_walk($xValues, function(&$value, $index) {
+    array_walk($xValues, function (&$value, $index) {
       $value = (string) $value;
     });
     $xLabels->set_labels($xValues);
@@ -187,8 +195,8 @@ class CRM_Utils_OpenFlashChart {
    * @param array $params
    *   Assoc array of name/value pairs.
    *
-   * @return object $chart   object of open flash chart.
-   * @static
+   * @return object
+   *   $chart   object of open flash chart.
    */
   public static function &pieChart(&$params) {
     $chart = NULL;
@@ -251,8 +259,8 @@ class CRM_Utils_OpenFlashChart {
    * @param array $params
    *   Assoc array of name/value pairs.
    *
-   * @return object $chart   object of open flash chart.
-   * @static
+   * @return object
+   *   $chart   object of open flash chart.
    */
   public static function &bar_3dChart(&$params) {
     $chart = NULL;
@@ -444,13 +452,12 @@ class CRM_Utils_OpenFlashChart {
       foreach ($rows['multiValue'] as $key => $val) {
         $graph[$key] = array_combine($dateKeys, $rows['multiValue'][$key]);
       }
-      $chartData =
-        array(
-          'legend' => "$legend " . CRM_Utils_Array::value('legend', $rows, ts('Contribution')) . ' ' . ts('Summary'),
-          'values' => $graph[0],
-          'multiValues' => $graph,
-          'barKeys' => CRM_Utils_Array::value('barKeys', $rows, array()),
-        );
+      $chartData = array(
+        'legend' => "$legend " . CRM_Utils_Array::value('legend', $rows, ts('Contribution')) . ' ' . ts('Summary'),
+        'values' => $graph[0],
+        'multiValues' => $graph,
+        'barKeys' => CRM_Utils_Array::value('barKeys', $rows, array()),
+      );
     }
 
     // rotate the x labels.
@@ -465,7 +472,10 @@ class CRM_Utils_OpenFlashChart {
 
     // carry some chart params if pass.
     foreach (array(
-      'xSize', 'ySize', 'divName') as $f) {
+               'xSize',
+               'ySize',
+               'divName',
+             ) as $f) {
       if (!empty($rows[$f])) {
         $chartData[$f] = $rows[$f];
       }
@@ -502,7 +512,10 @@ class CRM_Utils_OpenFlashChart {
 
     // carry some chart params if pass.
     foreach (array(
-      'xSize', 'ySize', 'divName') as $f) {
+               'xSize',
+               'ySize',
+               'divName',
+             ) as $f) {
       if (!empty($rows[$f])) {
         $chartData[$f] = $rows[$f];
       }
@@ -555,4 +568,5 @@ class CRM_Utils_OpenFlashChart {
 
     return $openFlashChart;
   }
+
 }