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

ShapeDefaults.fill

configuration

Defines the fill options of the shape. Use these settings to apply a single-color or a gradient background to all shapes in the Diagram.

shapeDefaults.fill

String|Object
<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    layout: "tree",
    shapeDefaults: {
      fill: {
        color: "red",
        opacity: 0.5
      }
    },
    shapes: [{
      id: "1",
      content: {
        text: "Monday"
      }
    }, {
      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 fill color of the shape.

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

Defines the gradient fill of the shape.

<div id="diagram"></div>
<script>
  $("#diagram").kendoDiagram({
    layout: "tree",
    shapeDefaults: {
      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
            }
          ]
        }
      }
    },
    shapes: [{
      id: "1",
      content: {
        text: "Monday"
      }
    }, {
      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 fill opacity of the shape.

Default: 1

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapeDefaults: {
        fill: {
            color: "red",
            opacity: 0.5
        }
    },
    shapes: [
        { id: "1", x: 100, y: 100, content: { text: "Semi-transparent Shape" } }
    ]
});
</script>