Subject: [PATCH] Resolve warning undefined array key
---
Index: modules/charts_chartjs/src/Plugin/chart/Library/Chartjs.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/modules/charts_chartjs/src/Plugin/chart/Library/Chartjs.php b/modules/charts_chartjs/src/Plugin/chart/Library/Chartjs.php
--- a/modules/charts_chartjs/src/Plugin/chart/Library/Chartjs.php	(revision d61a64d51caf5a211355f2a61a7a17f4a233d927)
+++ b/modules/charts_chartjs/src/Plugin/chart/Library/Chartjs.php	(date 1785844125382)
@@ -566,7 +566,10 @@
           }
           else {
             if ($chart_type === 'scatter') {
-              $data = ['y' => $data[1], 'x' => $data[0]];
+              $data = [
+                  'x' => $data[0] ?? 0,
+                  'y' => $data[1] ?? 0,
+              ];
             }
             if ($chart_type === 'bubble') {
               /*
@@ -574,7 +577,11 @@
                * For suggestions about how to deal with this, see:
                * https://github.com/chartjs/Chart.js/issues/3355
                */
-              $data = ['y' => $data[1], 'x' => $data[0], 'r' => $data[2]];
+              $data = [
+                  'x' => $data[0] ?? 0,
+                  'y' => $data[1] ?? 0,
+                  'r' => $data[2] ?? 0,
+              ];
             }
             // Convert the array from Views when using pie-type charts
             // and no label field.
