+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
// get the required data.
$chartTitle = !empty($params['legend']) ? $params['legend'] : ts('Bar Chart');
// get the required data.
$chartTitle = !empty($params['legend']) ? $params['legend'] : ts('Bar Chart');
foreach ($allValues as $label => $value) {
$values[] = new pie_value((double) $value, $label);
}
$graphTitle = !empty($params['legend']) ? $params['legend'] : ts('Pie Chart');
// get the currency.
foreach ($allValues as $label => $value) {
$values[] = new pie_value((double) $value, $label);
}
$graphTitle = !empty($params['legend']) ? $params['legend'] : ts('Pie Chart');
// get the currency.
public static function chart($rows, $chart, $interval) {
$lcInterval = strtolower($interval);
$label = ucfirst($lcInterval);
public static function chart($rows, $chart, $interval) {
$lcInterval = strtolower($interval);
$label = ucfirst($lcInterval);
'year' => ts('Yearly'),
'fiscalyear' => ts('Yearly (Fiscal)'),
'month' => ts('Monthly'),
'quarter' => ts('Quarterly'),
'week' => ts('Weekly'),
'yearweek' => ts('Weekly'),
'year' => ts('Yearly'),
'fiscalyear' => ts('Yearly (Fiscal)'),
'month' => ts('Monthly'),
'quarter' => ts('Quarterly'),
'week' => ts('Weekly'),
'yearweek' => ts('Weekly'),
}
foreach ($rows['multiValue'] as $key => $val) {
$graph[$key] = array_combine($dateKeys, $rows['multiValue'][$key]);
}
}
foreach ($rows['multiValue'] as $key => $val) {
$graph[$key] = array_combine($dateKeys, $rows['multiValue'][$key]);
}
'legend' => "$legend " . CRM_Utils_Array::value('legend', $rows, ts('Contribution')) . ' ' . ts('Summary'),
'values' => $graph[0],
'multiValues' => $graph,
'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()),
- );
+ 'barKeys' => CRM_Utils_Array::value('barKeys', $rows, []),
+ ];
$chartData['yname'] = CRM_Utils_Array::value('yname', $rows);
// carry some chart params if pass.
$chartData['yname'] = CRM_Utils_Array::value('yname', $rows);
// carry some chart params if pass.
'values' => $graph,
'legend' => $chartInfo['legend'],
'xname' => $chartInfo['xname'],
'yname' => $chartInfo['yname'],
'values' => $graph,
'legend' => $chartInfo['legend'],
'xname' => $chartInfo['xname'],
'yname' => $chartInfo['yname'],
if ($chart && is_array($params) && !empty($params)) {
// build the chart objects.
$chartObj = CRM_Utils_OpenFlashChart::$chart($params);
if ($chart && is_array($params) && !empty($params)) {
// build the chart objects.
$chartObj = CRM_Utils_OpenFlashChart::$chart($params);
// generate unique id for this chart instance
$uniqueId = md5(uniqid(rand(), TRUE));
// generate unique id for this chart instance
$uniqueId = md5(uniqid(rand(), TRUE));