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

Connection Text Visibility?

1 Answer 87 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 29 Jun 2016, 11:01 PM
I've dug through every readily available example (that I can find) of the UI for MVC Diagram, and can't find any way to show or display the "Text" attribute of a Connection. I'm seeing that the "Text" member is correctly being passed from controller to view (and is editable to boot), but don't see any way to display it on the view. Is this at all possible with the Diagram control for MVC?

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 30 Jun 2016, 10:16 AM
Hello,

Here is a simple example of how to put a text of the connection: http://dojo.telerik.com/@ruzhenov/ISoxE

and the code itself:

<div id="diagram"></div>
<script>
    var Point = kendo.dataviz.diagram.Point;
    var diagram = $("#diagram").kendoDiagram({ }).getKendoDiagram();
    var shapeA = diagram.addShape(new Point(100, 100));
    var shapeB = diagram.addShape(new Point(400, 100));
    var connection = diagram.connect(shapeA, shapeB, {
        stroke: { color: "red" },
        hover: {
            stroke: {
                color: "blue"
            }
        },
      content:{text: "Hello"}
    });
</script>


Also, you could look slo at the API reference at: http://docs.telerik.com/kendo-ui/api/javascript/dataviz/diagram/connection#configuration-content.text where it pointed:

content.text String

The static text displayed on the connection.

I hope that will help.

Regards,
Bozhidar
Telerik
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
Tags
Diagram
Asked by
Edward
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or