Przeglądaj źródła

fix: pin pie chart height to avoid resize feedback loop (#6019)

The pie chart on index2.html was initialized without an explicit
height, putting ApexCharts in 100%-of-container mode. On browser zoom,
Edge re-fires resize events more aggressively than other browsers, and
ApexCharts' ResizeObserver got caught in a feedback loop with the
container -- chart resizes, container resizes, chart resizes... visible
as continuous flicker.

Pins chart.height to 350px in the donut chart options. Breaks the loop
without changing the chart's visual size at default zoom.
Aigars Silkalns 12 godzin temu
rodzic
commit
d6db29605d
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      src/html/pages/index2.astro

+ 4 - 1
src/html/pages/index2.astro

@@ -1348,7 +1348,10 @@ createSparklineChart("#table-sparkline-7", table_sparkline_7_data)
 const pie_chart_options = {
   series: [700, 500, 400, 600, 300, 100],
   chart: {
-    type: "donut"
+    type: "donut",
+    // Pin an explicit height to avoid an ApexCharts ResizeObserver feedback
+    // loop on browser zoom (most visible on Edge). Fixes #6019.
+    height: 350
   },
   labels: ["Chrome", "Edge", "FireFox", "Safari", "Opera", "IE"],
   dataLabels: {