- Home
- Forum
- ASP.NET MVC
- Need to fix nodeTemplate according to attachment Please advise me
Need to fix nodeTemplate according to attachment Please advise me
Need to fix nodeTemplate
according to attachment
Please advise me
Attachment: CaptureDiagramQT_ce1585b2.zip
SIGN IN To post a reply.
5 Replies
SG
Shyam G
Syncfusion Team
January 11, 2018 10:06 AM UTC
Hi Miclejee,
We have created a sample to achieve your requirement and it is available for download in the below link.
In the above sample, we have rendered an layout with image node in which we have positioned the image at left side by using node’s contentAlignment property(refer help documentation below) and rendered two labels in it. One label is rendered as an hyperlink/URL by using label’s hyperlink property. Here is the sample output image.
Output image:
We have used nodeTemplate function to set labels and image for each node. please refer to the code example below.
Code example:
function nodeTemplate(diagram, node) {
node.source = node.ImageUrl;
node.labels[0].text = node.Role;
node.labels[1].hyperlink = node.Hyperlink;
}
Help documentation: https://help.syncfusion.com/aspnetmvc/diagram/shapes#image
Regards,
Shyam G
MJ
MJ
January 14, 2018 01:11 PM UTC
THX.
SG
Shyam G
Syncfusion Team
January 15, 2018 10:12 AM UTC
Hi Miclejee,
Please let us know if you need further assistance on this.
Regards,
Shyam G
MJ
MJ
January 19, 2018 09:56 AM UTC
You recommend to use it well. Picture 1
But the URL is long and out of frame.
I can Show Text "More .." When clicked, open the URL. Picture 2
Help guide
Attachment: Diagram_ed2c6d8d.zip
KU
Kutraleeswaran
Syncfusion Team
January 22, 2018 12:51 PM UTC
Hi Miclejee,
It can be done by setting label’s TextOverflow property as true and label’s OverflowType as Ellipsis.
Code Snippet:
Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label label = new Label();
label.TextOverflow = true;
label.OverflowType = OverflowType.Ellipsis;
If you need to achieve this requirement in node template, please use the below code example.
Code example based on Node Template:
function nodeTemplate(diagram, node) {
node.source = node.ImageUrl;
node.labels[0].text = node.Role;
node.labels[1].hyperlink = node.Hyperlink;
node.labels[1].TextOverflow = true;
node.labels[1].OverflowType = OverflowType.Ellipsis;
}
Regards,
S.Kutraleeswaran
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
MJ MJ
- Jan 11, 2018 02:55 AM UTC
- Jan 22, 2018 12:51 PM UTC