New to Kendo UI for jQueryStart a free 30-day trial

Stroke

configuration

Defines the stroke options of the connector.

stroke

String|Object
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: "Shape 1",
        x: 100,
        y: 100
    }, {
        id: "2", 
        content: "Shape 2",
        x: 300,
        y: 100
    }],
    connections: [{
        from: "1",
        to: "2"
    }],
    connectionDefaults: {
        fromConnector: {
            stroke: {
                color: "navy",
                width: 2,
                dashType: "solid"
            }
        }
    }
});
</script>

Defines the stroke color.

Default: "Black"

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: "Shape 1",
        x: 100,
        y: 100
    }, {
        id: "2", 
        content: "Shape 2",
        x: 300,
        y: 100
    }],
    connections: [{
        from: "1",
        to: "2"
    }],
    connectionDefaults: {
        fromConnector: {
            stroke: {
                color: "darkgreen"
            }
        }
    }
});
</script>

The stroke dash type.

The following dash types are supported:

  • "dash" - a line consisting of dashes
  • "dashDot" - a line consisting of a repeating pattern of dash-dot
  • "dot" - a line consisting of dots
  • "longDash" - a line consisting of a repeating pattern of long-dash
  • "longDashDot" - a line consisting of a repeating pattern of long-dash-dot
  • "longDashDotDot" - a line consisting of a repeating pattern of long-dash-dot-dot
  • "solid" - a solid line
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: "Shape 1",
        x: 100,
        y: 100
    }, {
        id: "2", 
        content: "Shape 2",
        x: 300,
        y: 100
    }],
    connections: [{
        from: "1",
        to: "2"
    }],
    connectionDefaults: {
        fromConnector: {
            stroke: {
                color: "purple",
                dashType: "longDash"
            }
        }
    }
});
</script>

Defines the thickness or width of the connector's stroke.

Default: 1

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: "Shape 1",
        x: 100,
        y: 100
    }, {
        id: "2", 
        content: "Shape 2",
        x: 300,
        y: 100
    }],
    connections: [{
        from: "1",
        to: "2"
    }],
    connectionDefaults: {
        fromConnector: {
            stroke: {
                color: "maroon",
                width: 3
            }
        }
    }
});
</script>