score:1

Accepted answer

you need to remove handlechangeoptions from the callback to see the effect. additionally it is enough to update the chart with only new options:

const handlechangeoptions = () => {
  const newlinedata = [
    {
      data: [...]
    },
    {
      data: [...]
    }
  ];
  const newoptions = { series: newlinedata };
  setchartoptions(newoptions);
};

live demo: https://codesandbox.io/s/angry-johnson-gpv99?file=/src/app.js

docs: https://github.com/highcharts/highcharts-react#optimal-way-to-update

score:0

after you update question. i saw the problem is you pass callback={handlechangeoptions} in highchartsreact. so you just remove it. everything will work normally.


Related Query

More Query from same tag