Edit this page

Increase the Stroke Size in the Chart Legend

Environment

Product Kendo UIĀ® Progress Kendo UI Chart
Progress Kendo UI version Created with the 2017.3.1026 version

Description

How can I change the size of the stroke next to the legend text in the Kendo UI Chart?

Solution

  1. Handle the render event of the Chart.
  2. In the render event handler, select the desired path with jQuery.
  3. Change the stroke-width attribute of the path.
<div id="chart"></div>
<script>
    $("#chart").kendoChart({
        legend: {
            labels: {
                font: "60px sans-serif"
            }
        },
        series: [{
                name: "Series 1",
                data: [1, 2, 3]
            },
            {
                name: "Series 2",
                data: [3, 4, 5]
            }
        ],
        render: function(e) {
            var el = e.sender.element;
            el.find("text:contains(Series 1)")
                .parent()
                .prev("path")
                .attr("stroke-width", 5);

            el.find("text:contains(Series 2)")
                .parent()
                .prev("path")
                .attr("stroke-width", 5);
        }
    });
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy