Describe the bug
I have created a Lens pie chart with two layers. While the pie chart is rendered correctly I can see on the legend bar (with the nested switch on) that the nested legends are not displayed correctly. Some of the values are repeated with a color of a different series.

Here the problem is more obvious:

To Reproduce
Steps to reproduce the behavior:
- Go to Kibana Lens
- Select the
kibana_sample_data_logs dataset
- Drag and drop the machine.os.keyword and the memory fields
- Switch on the nested legend from the top menu
- Check that the legends are not displayed correctly
Expected behaviour
The nested legends should appear without duplicates from other series.
Additional context
I have also found out this problem on migrating the vislib pie chart to the es-charts one.
Kibana cross-issue
elastic/kibana#84307
Describe the bug
I have created a Lens pie chart with two layers. While the pie chart is rendered correctly I can see on the legend bar (with the nested switch on) that the nested legends are not displayed correctly. Some of the values are repeated with a color of a different series.
Here the problem is more obvious:

To Reproduce
Steps to reproduce the behavior:
kibana_sample_data_logsdatasetExpected behaviour
The nested legends should appear without duplicates from other series.
Additional context
I have also found out this problem on migrating the vislib pie chart to the es-charts one.
Kibana cross-issue
elastic/kibana#84307