Demo: draggable bar (for barchart etc)
Define the polygon like this:
Polygon(P, Q, (0, y(Q)), (0, y(P)))
and then add this as its On Update script to make sure it stays at the same height and can't go negative:
SetCoords(P, If(x(P) < 0, 0, x(P)), 1)
SetValue(Q, P + (0, 1))
and then make sure "Selection Allowed" is unchecked for 3 of the segments. Also set Algebra -> Increment to eg 1 for Points P and Q (for keyboard control)
Try changing the "snap to grid" settings in the style bar.
Thanks to Anthony Or for the idea, as shown at #ggbconf2019. Here's a full example to show how it can be used geogebra.org/m/vmbuztsg