@oliasoft-open-source/charts-library 4.6.1 → 4.6.2-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -26809,11 +26809,13 @@ const LegendDropZones = (legendDropZonesProps) => {
26809
26809
  };
26810
26810
  const Legend2 = ({ chartRef, legendConfig }) => {
26811
26811
  const chart2 = chartRef == null ? void 0 : chartRef.current;
26812
- const { chartArea } = chart2 ?? {};
26812
+ const [chartArea, setChartArea] = useState(
26813
+ chart2 == null ? void 0 : chart2.chartArea
26814
+ );
26813
26815
  const {
26814
26816
  options: { legend: legend2 }
26815
26817
  } = legendConfig ?? {};
26816
- const [measureRef] = useMeasure$1();
26818
+ const [measureRef, measureRect2] = useMeasure$1();
26817
26819
  const resizeRef = measureRef;
26818
26820
  const panelRef = useRef(null);
26819
26821
  const [legendPosition, setLegendPosition] = useState(
@@ -26827,6 +26829,12 @@ const Legend2 = ({ chartRef, legendConfig }) => {
26827
26829
  isDragging: monitor.isDragging()
26828
26830
  })
26829
26831
  }));
26832
+ useEffect(() => {
26833
+ const timeout = setTimeout(() => {
26834
+ setChartArea(chart2 == null ? void 0 : chart2.chartArea);
26835
+ }, 20);
26836
+ return () => clearTimeout(timeout);
26837
+ }, [measureRect2]);
26830
26838
  return /* @__PURE__ */ jsxs(Fragment, { children: [
26831
26839
  /* @__PURE__ */ jsx("div", { ref: resizeRef, className: styles$3.resizeContainer }),
26832
26840
  /* @__PURE__ */ jsx(
@@ -26849,7 +26857,8 @@ const Legend2 = ({ chartRef, legendConfig }) => {
26849
26857
  setLegendPosition: (position) => setLegendPosition(position),
26850
26858
  isDragging: isDragging2,
26851
26859
  placeholderSize: panelSize
26852
- }
26860
+ },
26861
+ measureRect2.width
26853
26862
  )
26854
26863
  ] });
26855
26864
  };