Can you group the elements of the legend in kendoChart with JQuery?

0

Greetings, I would need to group the elements of a Kendochart series, so that they are separated as follows:

Group title 1 :
Series 1.
Series 2.
Group title 2 :
Series 3. Series 4.

I tried to do it with a template in the label as follows:


 legend: {
                labels: {
                    template: kendo.template($("legend-template").html())
                }
            },

Y en el Template, para luego acceder a través del ID:

<script id="legend-template" type="text/x-kendo-template"> <div id="Leyenda"> #: text # </div> </script> </code>

Thanks in advance, Greetings.

    
asked by David Fernández 22.12.2017 в 08:55
source

1 answer

0

RESOLVE The solution has been to create a div with a checkbox for each of the Series, so that Jquery alternates the visible property of each of the series in the chart.

For example it would be:

$("#SerieName").change(function () {
            if ($("#SerieName").is(":checked")) {
                $("#Chart").data("kendoChart").options.series[0].visible = true;
                $("#Chart").data("kendoChart").redraw();

            } else {

                $("#Chart").data("kendoChart").options.series[0].visible = false;
                $("#Chart").data("kendoChart").redraw();
            }
        });
    
answered by 09.01.2018 / 19:31
source