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 Query
- 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
- How to make Highcharts fetch data from external JSON file?
- how to display 2 same highcharts without duplicate the code
- How can I make React Native in Android aware of a click event in a tooltip in a Highcharts chart?
- 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?
- 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 ?
- Highcharts how to make legends as data labels on scatter plot
- Highcharts how to make a set number of colors for pie chart data and drilldown data
- How Highcharts ChartView redraw or wait for AsyncTask data in Android
- How can I change data series dynamically in HighCharts without overwriting initial series?
- How to shift data using Series.addPoint without shifting x axis values in highcharts
- how to make chart real time with 2 line and get data from php with highcharts
- How to update drilldown data in highchart without redraw the chart?
- how do i link my sqlite(PDO) databse data to highcharts code
- How to make multiple Y-axis with incoming series of data from database using Highcharts
- How to draw a chart from one array of data and make labels on the chart from another array of data? Highcharts v.4.0.4
- Changing data dynamically for a series in Highcharts
- How to show No Data Available Message in highcharts
- How to display No Data Available Message in highcharts
- Highcharts How to Show Loading Animation At Set Data
- How to make highcharts scrollable horizontally when having big range in x-axis
- How do I dynamically change a data point in Highcharts using JavaScript
- How to make stacked column graph to show total data value on top
- Changing Highcharts data series type dynamically
- Highcharts - Force Categories in x-axis to be shown, even without data
- how to set dynamic data in highcharts
- How to pass json data to highcharts series?
More Query from same tag
- Highcharts: Positioning the toolip with chart.plotLeft
- Highcharts spline chart not rendering in IE and mozilla
- Highcharts - Stack Graph Display Average of all values
- HightChart Error 13 with angular js, function and controller scope
- Rails - convert date string into javascript date object for highcharts
- Exporting highstock chart data shows data discrepancies
- angularjs, HighCharts (Aw, Snap!) crash
- How to display plotlines when only one value exists
- Plotting data using higcharts in flask web application
- Dispatch event `click` on plot options of pie highchart generate a redraw of chart.
- Newline axis labels exporting to SVG
- highcharts map bubble with categorized classes
- Highcharts, series with data of different size
- Include nested entity details but don't group by then when grouping by other fields
- how to configure highmaps of highcharts in ruby on rails?
- Highcharts Error #18 in - Highcharts.Chart(options)
- HighCharts. How to set a fixed width for a chart grid, not including labels?
- Wrong date in highstock Chart
- X-axis alignment for Columnrange
- HIGHCHARTS Treemap update is not working with animation
- How to dynamically change mouse event functions in Highchart?
- bar not displayed in Highcharts for Higher values
- Simplifying if else statements
- How do I change speedometer caption style changes in highcharts
- Highcharts legends are overlapping when i change language to arabic
- Override auto generated Y axis plot area values in Highcharts
- HIghchart Treemap - Add double click event on legend click
- R - Highcharter, How to avoid increasing the indentation of the y axis label?
- Yii vs Highcharts vs Ajax
- Error: GET http://mywebsite.com/tmp/highchart_oqoCdS 403 (Forbidden)