This is a migrated thread and some comments may be shown as answers.

Split Labels over multiple Lines

1 Answer 272 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 09 Feb 2016, 10:05 PM

We had some support from the Telerik team about a year ago when we wanted to split a connecting label over multiple lines. At the time, they advised us of a bug and gave us a workaround.

We've just had to update to the latest version of the Kendo UI js file to fix another bug related to a JQuery update, and it has broken our workaround. The original fix was to replace the standard text in the box, and add it into a tspan. Following the update, this now renders the tspan on the diagram following the new update. I've attached a screen of how it showed before, with the workaround, and how it shows now following the update.

The current value in the DescriptionForKendo field:

<tspan x="0" dy="0em">Class A, 50 Shares</tspan><tspan x="0" dy="1em">Class B, 100 Shares</tspan>

The binding of the field to the view:

.ConnectionDefaults(cd => cd.Editable(false).Content(o => o.Template("#= dataItem.DescriptionForKendo #"))

Any ideas if this was specifically catered for in the latest version, or how we can add a line break into a connecting label now?

 

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 12 Feb 2016, 06:18 AM
Hi,

This is a result of some substantial changes on how the Diagram is being rendered. We now support multiple rendering targets - SVG, Canvas and PDF to name a few.
This requires that we encode any HTML entities as they're SVG specific and will result in incorrect output in other rendering modes.

Our recommendation is to set up a visual template with absolutely positioned TextBlocks as illustrated in the API reference.

Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Diagram
Asked by
Jonathan
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or