Closed girlpunk closed 11 months ago
Hi and thanks for the report.
In general, it is not a good idea to use an IEnumerable
as the data source, because that expression is evaluated every time the chart is rendered, I was able to reproduce, but you can easily fix it by materializing your LINQ expression:
var series = ((MyEnumType[]) Enum.GetValues(typeof(MyEnumType)))
// Take a list, group it by a property of that enum, and count the groupings
.GroupJoin(...)
// Sort the groupings by the property value, to ensure they always appear in the same order
.OrderBy(static g => g.prop)
// Create a new PieSeries from each grouping
.Select(...)
.ToArray(); // <-- MATERIALIZE IT TO AN ARRAY OR LIST
This needs better docs, at this point the type IEnumerable
seems the best choice for the library, but it seems that it also causes some confuision.
I will close this for now but feel free to reply if that does not fix the issue or if you think that the library should work with the IEnumerable
type.
Describe the bug
To Reproduce Steps to reproduce the behavior:
Expected behavior The chart should render
Screenshots Expected outcome is something like this
Desktop (please complete the following information):
Additional context Did some testing with different versions, this works correctly up to
2.0.0-beta.920
, but is broken in2.0.0.rc1