Animation rendering fails into Pie Chart.
See original GitHub issueDo you want to request a feature or report a bug?
I would like to report a bug. Animation rendering fails into Pie Chart, there is space for improvement on the fallback.
What is the current behavior?
There is an intermittent failure on the chart rendering. As exposed on the gif below:
- The first rendering works nicely as expected.
- The second rendering (page reload) is intercepted somehow and a default rendering takes place removing the animation and the legend information.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: http://jsfiddle.net/ndLhnegs/).
http://jsfiddle.net/lcustodio/x5x1de34/
What is the expected behavior?
The animation to always work, and if some error happens fallback like it’s the case currently, but the label
and labelLine
function should be called as well.
In addition, some error logging in order to understand and try to solve the problem.
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
All the tests were made with Chrome 62 + macOS 10.13.1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:15 (2 by maintainers)
Top Results From Across the Web
Pie chart is not getting rendered in ChartJS - Stack Overflow
Here is the correct / proper way of creating a chart in Chart.js 2.x : $(document).ready(function() { loadDonutChart(); }); function ...
Read more >Create and animate an attractive pie chart in Cinema 4D
In this tutorial, we will talking about how to create and animate a pie chart in Cinema 4D.Follow my work on insta: ...
Read more >[2.79] Blender Tutorial: Pie Chart Animation - YouTube
I wanted to make more tutorials on the topic of math and statistics, so I decided to make a tutorial on how to...
Read more >Create a Pie Chart Animation in blender 2.83 EEVEE (EASY ...
Create a Pie Chart ( Pie Graph ) Animation in blender 2.83 EEVEE ( EASY and FAST tutorial ) 90% Procedural. If you...
Read more >Flutter animated Pie Chart [2022] - YouTube
In this video, you will learn how to create pie chart in flutter. Also you will learn how to step by step pie...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello guys! On #1624 issue, @klarstrup gave a solution that worked for me. Apparently this problem happens in other types of graphic too, as in my case, was using Bar.
The solution, proposed by @klarstrup, was to put a key prop on the BarChart component, so when it changes, the whole graphic will re-render, with all the animations. I just put key={Math.random()}, so he always renders now 😃
I ran into the same issue with a similar configuration using React Hooks. After reading @loopbender s answer and understanding that re-render causes this problem, I just tried to making my hook component as a PureComponent using
React.memo(...)
then this resolved my issue. For example:You can also see that all examples are implemented as a PureComponent on Recharts website. Hope this helps.