You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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
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
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.
The text was updated successfully, but these errors were encountered: