Comments (12)
Would that help?
https://github.com/kirjs/react-highcharts#limiting-highchart-rerenders
from react-highcharts.
@rizkiandrianto just use something like cloneDeep
from lodash
Example in React:
this.setState({ chart: cloneDeep(chart) })
from react-highcharts.
Thanks for the reply. It was actually a problem with how I used state in the parent react component. When clicking on a point it messaged the parent to change its state, which caused it to send new props and this caused my highcharts component to redraw (the parent is doing the AJAX reqs for the data since this data is used on other children of it aswell, meaning I do chart updating in componentWillReceiveProps).
When using isPureConfig what would be the proper way to trigger a chart redraw? In what react lifecycle method and exactly how would it be best?
Cheers!
from react-highcharts.
isPureConfig
works similarly to https://facebook.github.io/react/docs/pure-render-mixin.html
It won't update the chart if the config wasn't updated.
from react-highcharts.
I'm closing the issue, feel free to reopen it if if you need further help
from react-highcharts.
What's the correct way to redraw chart with a new data using isPureConfig
? I tried to use setOptions
, redraw
and series[0].setData
, but I got nothing useful. And where my highcharts config should live?
Ex. an app where we'are changing select value and redrawing new data on the same chart.
from react-highcharts.
@kirjs I couldn't make it work. Config is in state and isPureConfig
option is used. Could you help me?
from react-highcharts.
Hi Oleg, the config you're passing should be a reference to a object different from the original one.
It's best done with some immutable library, or you could deep clone the object.
from react-highcharts.
@kirjs oh, I was using deep cloning in a wrong place. My fault… Thanks for your response and your work 👍
from react-highcharts.
No worries, good luck with your project
from react-highcharts.
Is there a known issue if props of the parent changes and I re-render Treemap or Heatmap.
There is no issue while re-rendering a simple line chart.
The issue I see is TypeError: Cannot read property 'data classes' of undefined.
from react-highcharts.
Hi Oleg, the config you're passing should be a reference to a object different from the original one.
It's best done with some immutable library, or you could deep clone the object.
What do you mean different object @kirjs ? Would you give me example code to set state the config with isPureconfig?
Edit: I found a way that easier, chart.reflow(). Is it okay or will be a memory leak? or somthing like that?
from react-highcharts.
Related Issues (20)
- Questions about copyright HOT 1
- [Bug]: multi-data & category => xAxis is dislocation HOT 1
- Update an issue template to use stackblitz for an example HOT 1
- Update all the dependencies HOT 2
- Highcharts export functionality HOT 1
- react 16.8 hooks addPlotLine not work?
- Why opposite:true doesn't work in ReactHighstock?
- Demo project doesn't work.
- outside: true on Tooltip - Error when trying to trigger the tooltip manually
- Upgrade Highcharts - Cross Site Scripting vuln HOT 3
- HighCharts events not getting triggered
- Tooltip.positioner function not working
- cannot use boost HOT 1
- Chart not resizing with container
- All Bars are starting from 0 value in Stacked bar when render happens
- npm vulnerability issue Cross-site Scripting (XSS), need to upgrade highcharts dependency
- Cannot read property 'series' of undefined
- Wrong ordering with temporal data
- Can we do reset on navigator when we switch between custom zoom buttons.
- Incorrect Date Display on Highchart ReactHighstock X-Axis.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-highcharts.