Comments (6)
in componentDidMount. as stated in the example https://github.com/amcharts/amcharts3-react/tree/master/examples/create-react-app.
componentDidMount(){ this.setState({ // Update the chart dataProvider every 3 seconds timer: setInterval(() => { this.setState({ dataProvider: generateData() }); }, 3000) }); }
so every 3 seconds the data changes as well as in the view. However, If I try to go to another page then back to the page where the chart resides the view won't render the new generated data, though there's new generated data.
from amcharts3-react.
How are you updating the data?
from amcharts3-react.
@codestitch are you sure the component unmounted and re-mounted? You can check it easily by logging something in componentDidMount and changing route (navigating). Otherwise you can use the componentWillReceiveProps to restart the data refreshing cycle. http://busypeoples.github.io/post/react-component-lifecycle/
from amcharts3-react.
Hi,
I can reproduce when I change the route, however, I noticed something different.
I am using a stateless wrapper component that has data prop and pass this along with the config.dataProvider to AmCharts.React.
When I inspect the HTML, I see that tags in are empty after the new data is supplied through render().
Now, When the screen is resized the graph is visible again and tags get filled. When the data is updated, it goes back to empty tags.
The component is unmounted on route change (checked with componentWillUnmount), and mounts new that fails to display the graph.
Why does rerendering fails to redraw?
@xbojch What do you suggest in that case? Your last post couldn't point me to any direction.
Thanks,
D.
from amcharts3-react.
@codestitch Please provide me your code in a Gist or GitHub repo so I can figure out what the problem is.
from amcharts3-react.
Hi @doguhanokumus, could you find a solution to your reported issue, cause even i'm facing a similar issue, any help would be much appreciated.
from amcharts3-react.
Related Issues (20)
- There is no horizontal scroll HOT 3
- Facing "this.legend.destroy is not a function" when component unmounts HOT 2
- Images are not visible HOT 1
- Issue in reconstructing amcharts in React HOT 1
- on
- Uncaught TypeError: Cannot read property 'capture' of undefined HOT 1
- color changin HOT 1
- valueAxes is not working for X axis HOT 1
- when to release amcharts4-react HOT 2
- d.AmStockChart is not a constructor HOT 1
- Test cases failing: ReferenceError: AmCharts is not defined HOT 1
- How do I use methods if I use JSX? HOT 1
- Does AmCharts support react native HOT 1
- Custom ID to AmCharts HOT 1
- Line with lower value is appearing above the others HOT 1
- How to update config for amChart4 HOT 1
- is it available to set a colums / options for exporting csv?
- chart.removeListener is not a function after upgrade the Webpack 4 to 5
- Support for react v17.x in peerDependencies HOT 1
- separate tooltip texts for columns and bullets in AmCharts 3
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 amcharts3-react.