When SizeToContent is set on window, gauge renders very large.

Is there a better way to handle the auto sizing of the SFCircularGaue?
Whenever the main window has SizeToContent set to WidthAndHeight the gauge renders extremely large.
I realize I can set a max width and height, but I would rather the gauge scale in its grid position like any other control would (GroupBox, DataGrid, etc) when having HorizontalAlignment and VerticalAlignment set to Stretch.

EDIT:
FYI playing around with the radius and radius factor makes the gauge smaller like you would expect, but forces the window to be very large with empty space.

6 Replies

AK Ashwin Kumaravel Syncfusion Team October 16, 2017 05:53 AM UTC

Hi George,

Thanks for using Syncfusion products,

We have validated your query” When SizeToContent is set on window, gauge renders very large”. As per the behaviour of the Circular Gauge, if specific height and width is not mentioned then controls will render based on the parent’s height and width.

In Data Grid control, the control’s size is rendered based on its content size which means the size required to fit the content. So, can you please set specify height and width to the Gauge to render as per your requirement?

Please get back to us if you have any concerns,

Regards,
Ashwin 



GC George Carr October 16, 2017 11:03 AM UTC

Hello Ashwin,

Thank you for your response. I am aware that I can set width and height. However when the window is resized I am trying to avoid the gap this leaves. Please see the attached photo of one I threw together as an example. I feel like setting horizontal and vertical alignment should cause the gauge to act as any other control would and stretch to fill the available space. I understand that things like data grid size to content, but they also stretch even if empty. (see second attachment) I feel like the gauge imposes an arbitrary size on the window. Like I said in my second comment even forcing the gauge to be smaller with the radius it still forces window to a large size with much empty space around the control. I just don't understand why Syncfusion's control don't seem to care about the margin property.


Attachment: datagrid_f713146e.rar


GC George Carr October 16, 2017 11:04 AM UTC

Here is the attached gauge snippet. I didn't realize you could only have one attachment.


Attachment: Gauge_146828ea.rar


AK Ashwin Kumaravel Syncfusion Team October 17, 2017 07:36 AM UTC

Hi George,

Thanks for the update,

We have validated your attached screenshot of Data Grid and Circular Gauge controls. As per the behaviour of the Circular Gauge, if specific height and width is not given then the control will render by taking the minimum height and minimum width of the parent container.

Screenshot- 
 

In the attached above screenshot we could see that the gauge is getting resized based on the parent container’s height and width. This is the default behaviour of the Circular Gauge. But the container is not resized and fit properly in the above screenshot, so this is the reason why we are getting empty spaces around the Gauge.

Can you please provide the following details, so that we can provide you with a proper solution?

- Code snippet or sample project

-And please lets us know to which UI element you are adding CircularGauge and whether the UI element is getting resized when the Window is getting resized or not?

Regards
Ashwin
 



GC George Carr October 17, 2017 08:42 AM UTC

The circular gauge was not being resized to fit the group box, the group box had its height and width set to avoid empty space. See attach screenshot.

https://ibb.co/d2sabR

Code for the image:

I give up on trying to paste code into this site.. see link for code: https://pastebin.com/1G3sAnkz

https://ibb.co/mtobi6

Code that forces window to be very large:


I give up on trying to paste code into this site.. see link for code:https://pastebin.com/h1LW2jDT                   
               

           

       

   




AK Ashwin Kumaravel Syncfusion Team October 18, 2017 05:02 AM UTC

Hi George,

Thanks for the update,

We have validated your attached code snippets in which you have set specific height and width to the Gauge in one sample and you have not given in another sample.

As we mentioned earlier, if specific height and width is set, then the gauge will render based on the given height and width and it will not be responsive when the container is resized. If height and width is not given, then gauge will render with respect to parent container (Group Box) size.

To render gauge as per your requirement, can you please set required height and width to the Gauge’s container (Group Box) so that gauge will resize based on the container height and width.

Can you please send any mock up screenshot of your requirement with Gauge control so that we can able to create a sample based on your requirement and provide you a better solution

Regards,
Ashwin


Loader.
Up arrow icon