legend.item.visualFunction

A function that can be used to create a custom visual for the legend items. The available argument fields are:

  • options—The item options.
  • createVisual—A function for getting the default visual.

Example

<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 }
        ]
    },
    legend: {
        visible: true,
        item: {
            visual: function(e) {
                var rect = new kendo.drawing.Rect(e.rect, {
                    fill: {
                        color: e.options.areaBackground
                    },
                    stroke: {
                        color: "#000000"
                    }
                });
                return rect;
            }
        }
    }
});
</script>
In this article
legend.item.visual
Not finding the help you need?
Contact Support