shapes.fill.gradient Object

Defines the gradient fill of the shape.

Example - applying a gradient background to a 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>
In this article
Not finding the help you need? Improve this article