epezent / implot

Immediate Mode Plotting
MIT License
4.55k stars 503 forks source link

Pie chart colours flickering if data labels change, even with static `##` IDs #466

Open Fuuzetsu opened 1 year ago

Fuuzetsu commented 1 year ago

I have a simple pie chart with 4 pieces of data. I also wanted to display some percentage as part of the legend (as I am unsure how to do it on hover with pie-chart, or if it's even doable).

However, changing the data label, causes the colours to change. For example, here's one set of colours.

1

Then when data changes, so does the label: and I get a new set of colours.

2

I confirmed that if I remove the percentage display from label, colours stay static. So one may think that this is because of changing label IDs.

So I did what I usually do: assign static label IDs with ##. As expected, the ##some_id is not displayed: however, it does not solve the issue and the problem persists. On the screenshots above, you can see the data being fed in at the bottom and the static labels.

Is there some way to achieve what I'm describing? Is this just an oversight in implot?

I apologise for no code sample as my code is in Rust, using implot via some bindings. If you need, I can try to replicate in C++, it should be very simple...