From d7797bc21e296464bfca14783a7bc745920ff63d Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Mon, 11 Nov 2013 19:26:33 +0530 Subject: [PATCH] CRM-13735 --- CRM/Utils/OpenFlashChart.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/OpenFlashChart.php b/CRM/Utils/OpenFlashChart.php index 2ad178f63a..681ca668e7 100644 --- a/CRM/Utils/OpenFlashChart.php +++ b/CRM/Utils/OpenFlashChart.php @@ -106,7 +106,7 @@ class CRM_Utils_OpenFlashChart { // FIXME: for bars > 2, we'll need to come out with other colors $bars[$barCount]->colour( '#BF3B69'); } - + if ($barKey = CRM_Utils_Array::value($barCount, CRM_Utils_Array::value('barKeys', $params))) { $bars[$barCount]->key($barKey,12); } @@ -123,6 +123,11 @@ class CRM_Utils_OpenFlashChart { // create x axis label obj. $xLabels = new x_axis_labels(); + // set_labels function requires xValues array of string or x_axis_label + // type casting array to string + array_walk($xValues, function(&$value, $index) { + $value = (string)$value; + }); $xLabels->set_labels($xValues); // set angle for labels. @@ -429,7 +434,7 @@ class CRM_Utils_OpenFlashChart { foreach ($rows['multiValue'] as $key => $val) { $graph[$key] = array_combine($dateKeys, $rows['multiValue'][$key]); } - $chartData = + $chartData = array( 'legend' => "$legend " . CRM_Utils_Array::value('legend', $rows, ts('Contribution')) . ' ' . ts('Summary'), 'values' => $graph[0], -- 2.25.1