I'd like to maintain the initial aspect ratio when dragging/resizing a custom symbol in Pi vision. Whats the best way to achieve this?
There are 2 ways you can do this.
1. Set resizerMode property as 'AutoWidth' in your definition object for your custom symbol. This way, you will only see resizing handles on the top and bottom of the symbol and when you drag to increase the height the width will auto size as well. An example of this is the stock value symbol provided with Vision.
2. If resizerMode is not set, users can still hold down the shift key when resizing and it should also preserve the aspect ratio. This will require you to educate your users.
I had the resizerMode property initially set to "RetainAspectRatio" as it was one of the options for resizerMode in the Extensibility guide. I set resizerMode to 'AutoWidth' after seeing your reply. It did remove the horizontally placed resizing handles, but the symbol did not resize its width as i was changing the height.
Holding down the shift key during resizing (with the mode set to RetainAspectRatio) did work though.
I should also probably mention that this symbol is using the Amcharts library.Thanks for your help Eugene!
Retrieving data ...