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

Defines the gradient fill of the shape.

<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    layout: "tree",
    shapes: [{
      id: "1",
      content: {
        text: "Monday"
      },
      fill: {
        gradient: {
          type: "radial",
          center: [0.5, 0.5],
          radius: 0.9,
          stops: [
            {
              offset: 0,
              color: "lightblue",
              opacity: 0.5
            }, {
              offset: 0.5,
              color: "purple",
              opacity: 0.8
            }
          ]
        }
      }
    }, {
      id: "2",
      content: {
        text: "Tuesday"
      }
    }, {
      id: "3",
      content: {
        text: "Wednesday"
      }
    }],
    connections: [{
      from: "1",
      to: "2"
    },{
      from: "2",
      to: "3"
    }],
    connectionDefaults: {
      endCap: "ArrowEnd"
    }
  });
</script>

The center of the radial gradient.

Coordinates are relative to the shape bounding box. For example, [0, 0] is top left and [1, 1] is bottom right.

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        fill: {
            gradient: {
                type: "radial",
                center: [0.5, 0.5]
            }
        }
    }]
});
</script>

The end point of the linear gradient.

Coordinates are relative to the shape bounding box. For example, [0, 0] is top left and [1, 1] is bottom right.

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        fill: {
            gradient: {
                type: "linear",
                end: [1, 1]
            }
        }
    }]
});
</script>

The radius of the radial gradient relative to the shape bounding box.

Default: 1

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        fill: {
            gradient: {
                type: "radial",
                radius: 0.8
            }
        }
    }]
});
</script>

The start point of the linear gradient.

Coordinates are relative to the shape bounding box. For example, [0, 0] is top left and [1, 1] is bottom right.

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        fill: {
            gradient: {
                type: "linear",
                start: [0, 0]
            }
        }
    }]
});
</script>

The array of gradient color stops.

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        x: 100,
        y: 100,
        content: { text: "Shape 1" },
        fill: {
            gradient: {
                type: "linear",
                stops: [
                    { offset: 0, color: "red" },
                    { offset: 1, color: "blue" }
                ]
            }
        }
    }]
});
</script>

The type of the gradient. The supported values are:

  • linear
  • radial

Default: "linear"

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