If already played around and looked at first getting the extend of the graphic and then use getWidth and getHeight, but it seems this gives with the bounding box and not the graphic. Another option I was thinking of is calculating the line lengths of each side and then edit the points, but it feel like this might be an overcomplex solution.
It is fine if this is only possible with a polygon drawn with the rectangle drawing tool, however it should be possible to rotate this element. So what I want to achieve is a bit something like the screenshot underneath.
Do you have any opinions what the best way to tackle this with the Arcgis API