I use highcharts-react-official library.
I tried to update chart like this:
Code: Select all
useEffect(() => {
const maxVal = { week: 6, month: 4, year: 10.94 };
const series = isCompare ? chartSeriesCompare(data) : chartSeries(data);
setChartOptions({
series,
xAxis: { max: maxVal[data.period as keyof typeof maxVal] },
});
bugCycleTimeRef.current?.chart.destroy();
bugCycleTimeRef.current?.chart.xAxis[0].setCategories(getCategories(data.period));
}, [data]);
How can I recreate the chart in React?