implot icon indicating copy to clipboard operation
implot copied to clipboard

[Feature] Pie chart: no text and specify colors

Open CosminPerRam opened this issue 1 month ago • 0 comments

Feature description Hey! Some time ago I made a sorting visualizer by utilizing this great library and I'd like to add support for visualizing via pie plots, but I can't exactly do this as I'd like because:

  1. I can't specify what color I'd like an element to have (see photo 1)
  2. I can't hide the element's text (see photo 2)

Additionally, if it's possible I'd like to be able to set the weight/size of each element to be an equal amount to each (this is very visible in photo 1, the 12'o'clock right element is bigger than the left one).

Feature videos/screenshots Below I have attached some context screenshots amongst with some very ugly and hacky changes I attempted to made.

Photo 1: Can't specify colors for the pie elements. Image Fix: Called a custom function here to generate a color based on the element's value. https://github.com/epezent/implot/blob/81b8b1951392767cf458508385fa025fd087a252/implot_items.cpp#L2302

Photo 2: Can't hide element's text Image Fix: removed these lines https://github.com/epezent/implot/blob/81b8b1951392767cf458508385fa025fd087a252/implot_items.cpp#L2363-L2364

Photo 3: With both limits mitigated, this is something I'd like to have (note that the additional request I mentioned isn't that visible now). Image

The first problem (and the additional one) could maybe be solved via a flag, but for the second I'm not sure what the best solution would be. These requests sound a bit odd for a normal pie chart usecase but if these are not fit to be made for this library that's fine. If this issue could have better been split into separate ones please mention to do so and close this one. I'm sorry if I missed the obvious, haven't touched implot/imgui for a long while, thanks for the wonderful library and welcome new maintainer (:

CosminPerRam avatar Dec 03 '25 21:12 CosminPerRam