We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Determine Font Size of Diagrams' Nodes in SfDiagram

Hello. My question is simple: I want to set the font size of the diagrams' nodes. How can I achieve this?

Example: I want to change the font size of the text "Begin" "Process" etc. to more enormous.

NOTE: If I changed the diagram font size (like mydiagram.fontsize); it cannot succeed only rotator text changes. I demand to change the text of nodes.




3 Replies

RA Ranjitha Amirthalingam Syncfusion Team November 1, 2019 06:24 AM UTC

Hi Utemar, 
 
Thanks for contacting Syncfusion Support. 
 
Requirement: Need to change the font size of the text.  
 
We have support to achieve your requirement using “TextAnnotationViewModel”. We have provided code example and screenshot to represent this. Please refer to them as below. 
 
Code Example: 
<Syncfusion:NodeViewModel ID="Begin" OffsetX="300" OffsetY="60" Shape="{StaticResource Ellipse}" UnitHeight="40" UnitWidth="120"> 
   <Syncfusion:NodeViewModel.Annotations> 
    <!--Observable Collection of TextAnnotationViewModel--> 
     <Syncfusion:AnnotationCollection> 
       <Syncfusion:TextAnnotationViewModel Text="Begin" FontSize="18" FontStyle="Italic" FontWeight="Bold" Foreground="Yellow"/> 
     </Syncfusion:AnnotationCollection> 
 </Syncfusion:NodeViewModel.Annotations> 
</Syncfusion:NodeViewModel> 


Screenshot: 
 
 
For more information, please visit our online help documentation link. 
 
 
Regards, 
Ranjitha A. 



XH Xamarin Hunter replied to Ranjitha Amirthalingam November 18, 2019 10:17 PM UTC

Hi Utemar, 
 
Thanks for contacting Syncfusion Support. 
 
Requirement: Need to change the font size of the text.  
 
We have support to achieve your requirement using “TextAnnotationViewModel”. We have provided code example and screenshot to represent this. Please refer to them as below. 
 
Code Example: 
<Syncfusion:NodeViewModel ID="Begin" OffsetX="300" OffsetY="60" Shape="{StaticResource Ellipse}" UnitHeight="40" UnitWidth="120"> 
   <Syncfusion:NodeViewModel.Annotations> 
    <!--Observable Collection of TextAnnotationViewModel--> 
     <Syncfusion:AnnotationCollection> 
       <Syncfusion:TextAnnotationViewModel Text="Begin" FontSize="18" FontStyle="Italic" FontWeight="Bold" Foreground="Yellow"/> 
     </Syncfusion:AnnotationCollection> 
 </Syncfusion:NodeViewModel.Annotations> 
</Syncfusion:NodeViewModel> 


Screenshot: 
 
 
For more information, please visit our online help documentation link. 
 
 
Regards, 
Ranjitha A. 


Thanks. It's exact solution.


KR Karkuvel Rajan Shanmugavel Syncfusion Team November 19, 2019 05:19 AM UTC

  
Hi Utemar, 
 
Thanks for the update. 
 
Please contact us if you need any further assistance. 
 
Regards, 
Karkuvel Rajan S 


Loader.
Live Chat Icon For mobile
Up arrow icon