score:1
Accepted answer
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.
As a solution, call reflow
method after width
change.
useEffect(() => {
const chart = chartComponent.current?.chart;
if (chart) chart.reflow(false);
}, [width]);
Live demo: https://stackblitz.com/edit/react-zydh8m?file=index.js
API Reference: https://api.highcharts.com/class-reference/Highcharts.Chart#reflow
Source: stackoverflow.com
Related Articles
- how to make Highcharts React redraw without changing data
- How to have multiple highcharts with different series data in vuejs without repeating code
- How to make highcharts default to 0 for missing data
- Changing data dynamically for a series in Highcharts
- Changing Highcharts data series type dynamically
- Highcharts - Force Categories in x-axis to be shown, even without data
- Changing data in HighCharts series causes y-axis to blow up
- Highcharts - Global configuration with common code and unique data & Headings
- Get highcharts data without parseJSON
- force Highcharts redraw animation when changing graph type
- How to make Highcharts fetch data from external JSON file?
- how to display 2 same highcharts without duplicate the code
- Use of DotNet HighCharts dll to make charts in code behind
- How can I make React Native in Android aware of a click event in a tooltip in a Highcharts chart?
- Highcharts fill map based on data values with React TypeScript
- How to make buttons filter different data based on a category they select in Highcharts heatmap?
- How can I show all Timeline Highcharts data without any overlapping?
- Changing Color of Data Labels in HighCharts Bar Chart
- How to make the Y Axis values not start from 0 in highcharts? How to display forcefully display the last category data on X axis in HighCharts ?
- Data changing with Highcharts point.update
- Highcharts display label for pie chart using html table as data source
- Dynamically updating a highcharts object after data refresh in React
- Data filtration React Highcharts
- Highcharts dynamic data fetching in React
- Include additional highcharts source data in angular2 app
- Highcharts dynamic-update example - adding 1 new value every second - without historic data
- Highcharts how to make legends as data labels on scatter plot
- Fixing dataLabel position in pie charts Highcharts even when data is changing
- Changing backgroundcolor of tooltip for a specific data point in Highcharts
- Fixing/discounting a data series when changing chart-type in Highcharts
- Highcharts sort series data and redraw
- Labels string from Asp.net does not distributed in the highchart
- Highcharts: tickInterval on coloraxis
- how to get additional information by clicking a data point on bubble chart from data
- Highchairs Tooltip not showing accurate date time
- Why am I seeing two different point types in Highcharts?
- Highcharts isn't displaying the data
- Cannot display a legend with special character in highchart from the serie name
- Change the text of the back button on Highcharts Treemap?
- Highstock - Comparison chart should be start with 0%
- Remove spaces between columns in HighChart
- HighChart for PHP 5.1 lower
- Highcharts with live data: align chart on left side
- Highcharts milliseconds displaying incorrectly in xaxis
- Hide/show all series in Highcharts?
- Highcharts - multiple yAxis each with its own tooltip
- Highchart maps show some states as selected with feasibility to select other states
- Highcharts remove column defined by keys from export to CSV
- highcharts_column_id_on_click
- Add Offline Export chart capability in Angular-8