diff --git a/modules/charts_c3/src/Plugin/chart/C3.php b/modules/charts_c3/src/Plugin/chart/C3.php
index de99739338fa6fd3646d28bf94703ef5a5442592..8007823522807019277b444959f2e37574cc07b9 100644
--- a/modules/charts_c3/src/Plugin/chart/C3.php
+++ b/modules/charts_c3/src/Plugin/chart/C3.php
@@ -51,12 +51,13 @@ class C3 extends AbstractChart {
     }
 
     /**
-     * Depending on the number of data fields, the charts will either use data
-     * fields or label fields for the categories. If only one data field is
-     * selected, then the label field will serve as the categories. If multiple
-     * data fields are selected, they will become the categories.
+     * For pie and donut chart types, depending on the number of data fields,
+     * the charts will either use data fields or label fields for the
+     * categories. If only one data field is selected, then the label field
+     * will serve as the categories. If multiple data fields are selected,
+     * they will become the categories.
      * */
-    if ($options['type'] == 'pie' || $options['type'] == 'donut' ) {
+    if ($options['type'] == 'pie' || $options['type'] == 'donut') {
       if (count($seriesData) > 1) {
         $c3Data = [];
         for ($i = 0; $i < count($seriesData); $i++) {
@@ -82,8 +83,7 @@ class C3 extends AbstractChart {
         array_push($c3Data, $c3DataTemp);
       }
     }
-
-
+    
     $c3Chart = new ChartType();
     $c3Chart->setType($options['type']);
     $c3ChartTitle = new ChartTitle();
diff --git a/modules/charts_google/src/Plugin/chart/Google.php b/modules/charts_google/src/Plugin/chart/Google.php
index ed6602220c9ad100202f517819a28fdb0443c452..3c606d9048c1d64cf71865a651091548a9e3ee51 100644
--- a/modules/charts_google/src/Plugin/chart/Google.php
+++ b/modules/charts_google/src/Plugin/chart/Google.php
@@ -46,23 +46,63 @@ class Google extends AbstractChart {
       array_push($dataCount, $dataCountTemp);
     }
 
-    $dataTable = [];
-    for ($j = 0; $j < $categoriesCount; $j++) {
-      $rowDataTable = [];
-      for ($i = 0; $i < $seriesCount; $i++) {
-        $rowDataTabletemp = $seriesData[$i]['data'][$j];
-        array_push($rowDataTable, $rowDataTabletemp);
+    /**
+     * For pie and donut chart types, depending on the number of data fields,
+     * the charts will either use data fields or label fields for the
+     * categories. If only one data field is selected, then the label field
+     * will serve as the categories. If multiple data fields are selected,
+     * they will become the categories.
+     * */
+    if ($options['type'] == 'pie' || $options['type'] == 'donut') {
+      if ($seriesCount > 1) {
+        $dataTable = [];
+        for ($j = 0; $j < $seriesCount; $j++) {
+          $rowDataTable = [];
+          $rowDataTabletemp = array_sum($seriesData[$j]['data']);
+          array_push($rowDataTable, $rowDataTabletemp);
+          array_unshift($rowDataTable, $seriesData[$j]['name']);
+          array_push($dataTable, $rowDataTable);
+        }
+        $dataTableHeader = ['label','value'];
+        array_unshift($dataTable, $dataTableHeader);
+      }
+      else {
+        $dataTable = [];
+        for ($j = 0; $j < $categoriesCount; $j++) {
+          $rowDataTable = [];
+          for ($i = 0; $i < $seriesCount; $i++) {
+            $rowDataTabletemp = $seriesData[$i]['data'][$j];
+            array_push($rowDataTable, $rowDataTabletemp);
+          }
+          array_unshift($rowDataTable, $categories[$j]);
+          array_push($dataTable, $rowDataTable);
+        }
+        $dataTableHeader = [];
+        for ($r = 0; $r < $seriesCount; $r++) {
+          array_push($dataTableHeader, $seriesData[$r]['name']);
+        }
+        array_unshift($dataTableHeader, 'label');
+        array_unshift($dataTable, $dataTableHeader);
       }
-      array_unshift($rowDataTable, $categories[$j]);
-      array_push($dataTable, $rowDataTable);
     }
-
-    $dataTableHeader = [];
-    for ($r = 0; $r < $seriesCount; $r++) {
-      array_push($dataTableHeader, $seriesData[$r]['name']);
+    else {
+      $dataTable = [];
+      for ($j = 0; $j < $categoriesCount; $j++) {
+        $rowDataTable = [];
+        for ($i = 0; $i < $seriesCount; $i++) {
+          $rowDataTabletemp = $seriesData[$i]['data'][$j];
+          array_push($rowDataTable, $rowDataTabletemp);
+        }
+        array_unshift($rowDataTable, $categories[$j]);
+        array_push($dataTable, $rowDataTable);
+      }
+      $dataTableHeader = [];
+      for ($r = 0; $r < $seriesCount; $r++) {
+        array_push($dataTableHeader, $seriesData[$r]['name']);
+      }
+      array_unshift($dataTableHeader, 'label');
+      array_unshift($dataTable, $dataTableHeader);
     }
-    array_unshift($dataTableHeader, 'label');
-    array_unshift($dataTable, $dataTableHeader);
 
     $googleOptions = $this->createChartsOptions($options, $seriesData, $attachmentDisplayOptions);
     $googleChartType = $this->createChartType($options);
@@ -72,7 +112,6 @@ class Google extends AbstractChart {
     $variables['content_attributes']['data-chart'][] = json_encode($dataTable);
     $variables['attributes']['google-options'][1] = json_encode($googleOptions);
     $variables['attributes']['google-chart-type'][2] = json_encode($googleChartType);
-
   }
 
   /**