content alignment can not be set

I want to show digits at center of the gauge but non of Alignment property works both on Xaml or code behind

HorizontalContentAlignment="Center" and  VerticalContentAlignment="Center"


3 Replies

ET Eswaran Thirugnanasambandam Syncfusion Team October 20, 2021 10:29 AM UTC

Hi Afshin, 
 
Greetings from Syncfusion.  
 
We have checked your query and would like to inform you that, we can align the digital gauge digits at center of the gauge by setting the desired character width and height using the CharacterWidth and CharacterHeight properties as mentioned in the below code snippet.  
 
[XAML]: 
<gauge:SfDigitalGauge Value="11:59:50 PM" 
                      Height="100" 
                      Width="375" 
                      Background="Aqua" 
                      DimmedBrush="#F2F2F2" 
                      CharacterHeight="100" 
                      CharacterWidth="25" 
                      HorizontalAlignment="Center"  
                      VerticalAlignment="Center" 
                      CharacterType="EightCrossEightDotMatrix" 
                      CharacterStroke="#146CED" /> 
 
We have prepared a sample to achieve your requirement. Please get it from the below link.  
  
Please check the sample let us know if you have any further assistance.  
  
Regards,  
Eswaran. 



AF afshin October 20, 2021 04:04 PM UTC

Thanks but still Alignment does not apply to controller with changing Hight and width it is only visually align at center.

if the windows size change or we need to have controller stretch inside a grid cell it is not working



ET Eswaran Thirugnanasambandam Syncfusion Team October 21, 2021 09:11 AM UTC

Hi Afshin, 
 
Thanks for the update. 
 
We would like to inform that, in our current implementation the SfDigitalGauge’s Value is rendered from the starting position of the control and its width is depends on CharacterWidth, CharacterSpacing properties, not based on control width. So, we can’t stretch the SfDigitalGauge content based on the control width. We suggest using control height and character height property to position the SfDigitalGauge content at the center. 
 
Regards, 
Eswaran 


Loader.
Up arrow icon