I try to export diagram to Html. But connection caption is hidden in .html file. How can i add connection caption into .html?
2 Answers, 1 is accepted
0
Accepted
Martin Ivanov
Telerik team
answered on 02 Sep 2015, 01:42 PM
Hello Mihail,
I guess you are using the implementation from the RadDiagram.js file demonstrated in the diagram-html-export example. If so, keep in mind that the RDImporter from the example doesn't implement drawing of the connection's Content. In order to display it you will need to implement custom javascript code in the RadDiagram.js file that creates the text element for the connection's content. For example, you can plug the creation of the content in the "createConnections" function.
RDImporter.prototype.createConnections = function (connections) {
// some code
for(var i = 0; i < connections.length; i++) {
var connection = connections[i];
var connectionProps = this.extractConnectionProperties(connection);
var startP = this.parsePoint(connectionProps.startpoint);
var endP = this.parsePoint(connectionProps.endpoint);
// some code
if (connection.Properties["content"] != null) {
var content = connection.Properties["content"];
var text = new svg.TextBlock();
text.Text = content.trim();
text.dx = 5;
text.Background = "black";
this.diagram.MainLayer.Append(text);
var contentX = ((endP.x - startP.x) / 2) + startP.x;
var contentY = ((endP.y - startP.y) / 2) + startP.y;
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items