exportSVG

Exports the Sankey as an SVG document. The result can be saved using kendo.saveAs.

The export operation is asynchronous and returns a promise. The promise will be resolved with a SVG document encoded as a Data URI.

Example - Exporting the Sankey to an SVG document

<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 }
            ]
        }
    });

    var sankey = $("#sankey").getKendoSankey();
    sankey.exportSVG().done(function(data) {
        kendo.saveAs({
            dataURI: data,
            fileName: "sankey.svg"
        });
    });
</script>

Parameters

options Object (optional)Export options.
options.raw Boolean (default: false)Resolves the promise with the raw SVG document without the Data URI prefix.

ReturnsPromise A promise that will be resolved with a SVG document encoded as a Data URI.

In this article