Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to add a title to a diagram built using a layout (Read 2195 times)
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
How to add a title to a diagram built using a layout
Jun 20th, 2012 at 4:50pm
Print Post  
Hi,

I have built a diagram using the OrthogonalRouter layout and that is working fine.
How do I add a title to the top section of the diagram?

This sounds simple, but I am unable to find any useful reference to "title" in either the online documentation or in these forums.

A suggested technique/code would be much appreciated.

Thanks in advance

Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to add a title to a diagram built using a layout
Reply #1 - Jun 21st, 2012 at 8:33am
Print Post  
Hi,

Try this:

Code
Select All
RectangleF titleRect = diagram.GetContentBounds(false, true);
titleRect.Height = 20;
titleRect.Y -= 20;

ShapeNode title = diagram.Factory.CreateShapeNode(titleRect);
title.Text = "My diagram";
title.Font = new Font("Arial", 15);
//title.Transparent = true; // to hide the node's geometry

diagram.ResizeToFitItems(5); 



I hope that helps,
Stoyan
  

title.png (Attachment deleted)
Back to top
 
IP Logged
 
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Re: How to add a title to a diagram built using a layout
Reply #2 - Jun 21st, 2012 at 2:28pm
Print Post  
Exactly what I wanted.
Thanks
Jim
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint