Need a vertical plotline


#1

I am new to ImGUI. I find the plotline widget perfect, but I need it in a vertical orientation.
Look below for an example. The left part of the image is what I have, the right part is what I need. Suggestions?


#2

The PlotXXX functions are currently pretty simple/limited, but if you dig inside them you’ll find out they are fairly simple to rewrite yourself using the ImDrawList:: low-level drawing API.
You may want to just copy the function into your own files (using imgui_internal.h to access internal helpers) and tweak it however you want.


#3

Thank you for taking the time to reply, Omar!

I went into the code but I don’t see the current PlotLines() using any of the ImDrawlist:: primitives. I am confused at your suggestion.

Wouldn’t it be simpler to extend the PlotLines() with a couple of optional arguments that tell it to plot vertically top-down or bottom-up? The rest would be to adjust the hovering code to report the right values. I think i can take a shot at this.


#4

I went into the code but I don’t see the current PlotLines() using any of the ImDrawlist:: primitives. I am confused at your suggestion.

Not sure what to tell you other than to look again.

Wouldn’t it be simpler to extend the PlotLines() with a couple of optional arguments that tell it to plot vertically top-down or bottom-up? The rest would be to adjust the hovering code to report the right values. I think i can take a shot at this.

There’s a too many arguments already and way too many desirable Plotting features to fit in a single function signature. The plan is to eventually redesign Ploting from the ground up. In the meanwhile you can copy PlotEx and adjust it to your need.


#5

I successfully implemented what I needed by modifying PlotEx() very slightly. It now plots vertically, in the space allocated, either bottom-up or top-down, with x plotted left-right or right-left. The only thing I have not done is to render the title rotated, it still appears horizontal, at the top.

Would you like to see a patch?


#6

Nice!

You may post it as a reference for others (but then this sort of discussion should happen on the GitHub and not here), but I won’t apply the patch as-is. PlotXXX need an API redesign.


#7

OK! I will clean it up and post there. Thanks for your time!