Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Multiple SVG path errors when using updateSeries() method on Pie Chart when Animation argument is set to true #62

Closed
unknownentity123 opened this issue Aug 30, 2018 · 3 comments

Comments

@unknownentity123
Copy link

unknownentity123 commented Aug 30, 2018

When increasing the Series Array of a Pie Chart with the Animation argument set to true (default behavior) the pie chart will update to show a new set of pie slices but reveal them in a weird spinning fashing and any categories that were in excess of the originally drawn chart will not show a filled in color. The codesandbox.io example illustrates the issue. The decreasing case where a series is truncated shows similar weird animation updating but has all slices filled in. The behavior in Chrome directly (not through codesandbox.io) actually errors out in the console with multiple "Error: attribute d: Expected number ...." errors.

See Example of issue here:
https://codesandbox.io/s/l2porqmrk7

As another side issue related directly to this deals with the category labels in the legend update behavior. When increasing the series count, the chart will append onto the legend a generic name (somewhat understandable as the chart labels array is not being directly updated as a part of the updateSeries() method). Also when decreasing the series count, the legend leaves the original category labels and color sets as is also as a result of the labels array staying unaltered. Typically, other chart types get their series names within the series array of Javascript objects via the "name" property and key pair. I assume one could use the updateOptions() method with the updated labels array as a secondary method call and that should address the issue but I haven't attempted that as of this posting.

@junedchhipa
Copy link
Contributor

junedchhipa commented Aug 30, 2018

Very good explanation of the issue and I wish everyone to follow the same detailed information to reproduce the error on my side.

Coming back to your reported bugs,
I agree that the animations for pie/donut charts require some more attention now due to bugs reported by other users also. I will take care of the animation part.

Regarding labels in the legend, if you call updateSeries() then it doesn't contain labels naturally. An alternative is to call updateOptions() with both labels and series property inside it as you are adding data and not updating the same values.
I should have provided the same configuration as in axis charts

series: [{
  data: [32],
  name: ["label"]
}]

I will see if I can do it in the next updates.

@unknownentity123
Copy link
Author

Indeed....that actually never occurred to me to update both using the updateOptions directly. Thanks!

@junedchhipa
Copy link
Contributor

When the pie/donut series length is different while updating, the chart will animate from the beginning preventing the empty colored slices.

This will prevent the Error: attribute d: Expected number ...." errors.
Also, regarding the weird "spinning animation" while updating, I have tried something else as seen on this thread #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants