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

Title

configuration

The Sankey title configuration options.

title

Object
<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
    $("#sankey").kendoSankey({
        data: {
            nodes: [
                { id: 1, label: { text: "Node 1" } },
                { id: 2, label: { text: "Node 2" } },
                { id: 3, label: { text: "Node 3" } }
            ],
            links: [
                { sourceId: 1, targetId: 3, value: 2 },
                { sourceId: 2, targetId: 3, value: 1 }
            ]
        },
        title: {
            align: "center",
            background: "white",
            border: { color: "red", dashType: "solid", width: 1 },
            color: "black",
            font: "16px Arial,Helvetica,sans-serif",
            margin: { left: 0, right: 0 },
            padding: { left: 5, right: 5 },
            position: "top",
            text: "Title",
            visible: true
        }
    });
</script>

The alignment of the title.

  • "center" - the text is aligned to the middle.
  • "left" - the text is aligned to the left.
  • "right" - the text is aligned to the right.

Default: "center"

<div id="sankey"></div>
<script>
$("#sankey").kendoSankey({
    data: {
        nodes: [
            { id: 1, label: { text: "Solar" } },
            { id: 2, label: { text: "Electricity" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 40 }
        ]
    },
    title: {
        text: "Energy Flow",
        align: "left"
    }
});
</script>

The background color of the title. Accepts a valid CSS color string, including hex and rgb.

Default: "white"

<div id="sankey"></div>
<script>
$("#sankey").kendoSankey({
    data: {
        nodes: [
            { id: 1, label: { text: "Solar" } },
            { id: 2, label: { text: "Electricity" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 40 }
        ]
    },
    title: {
        text: "Energy Flow",
        background: "#f0f0f0"
    }
});
</script>

The border of the title.

<div id="sankey"></div>
<script>
$("#sankey").kendoSankey({
    data: {
        nodes: [
            { id: 1, label: { text: "Solar" } },
            { id: 2, label: { text: "Electricity" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 40 }
        ]
    },
    title: {
        text: "Energy Flow",
        border: {
            color: "#000000",
            width: 2
        }
    }
});
</script>

The text color of the title. Accepts a valid CSS color string, including hex and rgb.

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram",
        color: "#ff0000"
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>

The accessible description of the Sankey. The description is announced by screen readers when the Sankey is focused.

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram",
        description: "A sankey diagram showing data flow"
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>

The font of the title.

Default: "16px Arial,Helvetica,sans-serif"

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram",
        font: "20px Georgia, serif"
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>
Number|Object

The margin of the title. A numeric value will set all margins.

Default: 5

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram",
        margin: 20
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>
Number|Object

The padding of the title. A numeric value will set all margins.

Default: 5

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram",
        padding: 20
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>

The position of the title.

  • "bottom" - the title is positioned on the bottom.
  • "top" - the title is positioned on the top.

Default: "top"

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram",
        position: "bottom"
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>

The text of the Sankey title. You can also set the text directly for a title with default options.

The text can be split into multiple lines by using line feed characters ("\n").

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram\nData Flow Visualization"
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>

If set to false the Sankey will not display the title.

Default: true

<div id="sankey" style="width: 500px; height: 200px;"></div>
<script>
$("#sankey").kendoSankey({
    title: {
        text: "Sankey Diagram",
        visible: false
    },
    data: {
        nodes: [
            { id: 1, label: { text: "Node 1" } },
            { id: 2, label: { text: "Node 2" } }
        ],
        links: [
            { sourceId: 1, targetId: 2, value: 1 }
        ]
    }
});
</script>