dev/core#1409 Remove net_amount from Addtional Payment form
[civicrm-core.git] / CRM / Contribute / Form / ContributionCharts.php
index f8c10cd1ccd842bc8b10e4b411ca05cb9e80367a..158db37c79d4a4dfa8e2b2aed42b6f972998afeb 100644 (file)
@@ -66,10 +66,9 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
     //p3 = Three dimensional pie chart.
     //bvg = Vertical bar chart
     $this->addElement('select', 'chart_type', ts('Chart Style'), [
-        'bvg' => ts('Bar'),
-        'p3' => ts('Pie'),
-      ]
-    );
+      'bvg' => ts('Bar'),
+      'p3' => ts('Pie'),
+    ]);
     $defaultValues['chart_type'] = $this->_chartType;
     $this->setDefaults($defaultValues);
 
@@ -174,11 +173,11 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
         $monthlyChart = TRUE;
       }
 
-      $values['divName'] = "open_flash_chart_{$chartKey}";
+      $values['divName'] = "chart_{$chartKey}";
       $funName = ($chartType == 'bvg') ? 'barChart' : 'pieChart';
 
       // build the chart objects.
-      $values['object'] = CRM_Utils_OpenFlashChart::$funName($values);
+      $values['object'] = CRM_Utils_Chart::$funName($values);
 
       //build the urls.
       $urlCnt = 0;
@@ -231,8 +230,8 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
     // finally assign this chart data to template.
     $this->assign('hasYearlyChart', $yearlyChart);
     $this->assign('hasByMonthChart', $monthlyChart);
-    $this->assign('hasOpenFlashChart', empty($chartData) ? FALSE : TRUE);
-    $this->assign('openFlashChartData', json_encode($chartData));
+    $this->assign('hasChart', empty($chartData) ? FALSE : TRUE);
+    $this->assign('chartData', json_encode($chartData ?? []));
   }
 
 }