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

Fill.gradient.stops

configuration

The array of gradient color stops.

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: {
            text: "Multi-Stop Gradient"
        },
        fill: {
            gradient: {
                type: "linear",
                start: [0, 0],
                end: [1, 0],
                stops: [
                    { offset: 0, color: "red" },
                    { offset: 0.3, color: "yellow" },
                    { offset: 0.7, color: "green" },
                    { offset: 1, color: "blue" }
                ]
            }
        }
    }]
});
</script>

The color in any of the following formats.

FormatDescription
redBasic or Extended CSS Color name
#ff0000Hex RGB value
rgb(255, 0, 0)RGB value

Specifying 'none', 'transparent' or '' (empty string) will clear the fill.

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: {
            text: "Color Stop Example"
        },
        fill: {
            gradient: {
                type: "linear",
                start: [0, 0],
                end: [1, 0],
                stops: [
                    { offset: 0, color: "#ff0000" },
                    { offset: 0.5, color: "rgb(0, 255, 0)" },
                    { offset: 1, color: "blue" }
                ]
            }
        }
    }]
});
</script>

The stop offset from the start of the element. Ranges from 0 (start of gradient) to 1 (end of gradient).

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: {
            text: "Custom Offsets"
        },
        fill: {
            gradient: {
                type: "linear",
                start: [0, 0],
                end: [1, 0],
                stops: [
                    { offset: 0, color: "black" },
                    { offset: 0.2, color: "gray" },
                    { offset: 0.8, color: "lightgray" },
                    { offset: 1, color: "white" }
                ]
            }
        }
    }]
});
</script>

The fill opacity. Ranges from 0 (completely transparent) to 1 (completely opaque).

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "1",
        content: {
            text: "Opacity Gradient"
        },
        fill: {
            gradient: {
                type: "linear",
                start: [0, 0],
                end: [1, 0],
                stops: [
                    { offset: 0, color: "red", opacity: 1 },
                    { offset: 0.5, color: "red", opacity: 0.5 },
                    { offset: 1, color: "red", opacity: 0 }
                ]
            }
        }
    }]
});
</script>