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

Shapes.stroke

configuration

Defines the shape border stroke configuration.

<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    layout: "tree",
    shapes: [{
      id: "1",
      content: {
        text: "Monday"
      },
      stroke: {
        color: "yellow",
        width: 3,
        dashType: "dashDot"
      }
    }, {
      id: "2",
      content: {
        text: "Tuesday"
      }
    }, {
      id: "3",
      content: {
        text: "Wednesday"
      }
    }],
    connections: [{
      from: "1",
      to: "2"
    },{
      from: "2",
      to: "3"
    }],
    connectionDefaults: {
      endCap: "ArrowEnd"
    }
  });
</script>

Defines the color of the shape stroke.

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        stroke: {
            color: "purple"
        }
    }]
});
</script>

The dash type of the shape.

The following dash types are supported:

  • "dash" - A line that consists of dashes
  • "dashDot" - A line that consists of a repeating pattern of dash-dot
  • "dot" - A line that consists of dots
  • "longDash" - A line that consists of a repeating pattern of long-dash
  • "longDashDot" - A line that consists of a repeating pattern of long-dash-dot
  • "longDashDotDot" - A line that consists of a repeating pattern of long-dash-dot-dot
  • "solid" - A solid line
<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        stroke: {
            dashType: "dot"
        }
    }]
});
</script>

Defines the line cap style of the stroke. Supported values are "butt", "round", and "square".

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
      stroke: {
        lineCap: "round",
        width: 4
      }
    }]
});
</script>

Defines the line join style of the stroke. Supported values are "bevel", "miter", and "round".

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
      stroke: {
        lineJoin: "round",
        width: 4
      }
    }]
});
</script>

Defines the thickness or width of the shape stroke.

Default: 1

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        stroke: {
            width: 3
        }
    }]
});
</script>