DEV: drops jquery usage in stacked chart (#14946)

DEV: drops jquery usage in stacked chart (#14946)

diff --git a/app/assets/javascripts/admin/addon/components/admin-report-stacked-chart.js b/app/assets/javascripts/admin/addon/components/admin-report-stacked-chart.js
index d94d6c3..81e0171 100644
--- a/app/assets/javascripts/admin/addon/components/admin-report-stacked-chart.js
+++ b/app/assets/javascripts/admin/addon/components/admin-report-stacked-chart.js
@@ -5,28 +5,21 @@ import loadScript from "discourse/lib/load-script";
 import { makeArray } from "discourse-common/lib/helpers";
 import { number } from "discourse/lib/formatter";
 import { schedule } from "@ember/runloop";
+import { bind } from "discourse-common/utils/decorators";
 
 export default Component.extend({
   classNames: ["admin-report-chart", "admin-report-stacked-chart"],
 
-  init() {
-    this._super(...arguments);
-
-    this.resizeHandler = () =>
-      discourseDebounce(this, this._scheduleChartRendering, 500);
-  },
-
   didInsertElement() {
     this._super(...arguments);
 
-    $(window).on("resize.chart", this.resizeHandler);
+    window.addEventListener("resize", this._resizeHandler);
   },
 
   willDestroyElement() {
     this._super(...arguments);
 
-    $(window).off("resize.chart", this.resizeHandler);
-
+    window.removeEventListener("resize", this._resizeHandler);
     this._resetChart();
   },
 
@@ -36,6 +29,11 @@ export default Component.extend({
     discourseDebounce(this, this._scheduleChartRendering, 100);
   },
 
+  @bind
+  _resizeHandler() {
+    discourseDebounce(this, this._scheduleChartRendering, 500);
+  },
+
   _scheduleChartRendering() {
     schedule("afterRender", () => {
       if (!this.element) {
@@ -149,9 +147,7 @@ export default Component.extend({
   },
 
   _resetChart() {
-    if (this._chart) {
-      this._chart.destroy();
-      this._chart = null;
-    }
+    this._chart?.destroy();
+    this._chart = null;
   },
 });

GitHub sha: c768c2ab3a9fa0d20a0bf2e0e5d1e1e80e88fbd4

This commit appears in #14946 which was approved by CvX. It was merged by jjaffeux.