score:1

Accepted answer

you need to call chart.reflow method in onresizestop event callback function.

return (
  <rnd
    ...
    onresizestop={(e, direction, ref, delta, position) => {
      const chart = this.chartcomponent.current?.chart;
      if (chart) {
        chart.reflow();
      }
      ...
    }}
  >
    ...
  </rnd>
);

from highcharts api:

reflow( [e])

reflows the chart to its container. by default, the chart reflows automatically to its container following a window.resize event, as per the chart.reflow option. however, there are no reliable events for div resize, so if the container is resized without a window resize event, this must be called explicitly.


live demo: https://codesandbox.io/s/cranky-hoover-cz-czw5k?file=/src/index.js

api reference: https://api.highcharts.com/class-reference/highcharts.chart#reflow


Related Query

More Query from same tag