Using template for Chart Legend Labels

5 posts, 0 answers
  1. Erwin
    Erwin avatar
    1 posts
    Member since:
    Aug 2012

    Posted 10 Aug 2012 Link to this post

    Hi,

    can anyone show me how to use a template for the labels in a chart legend in Kendo for MVC? The fluent api allows for controlling font, color, position, etc, but the labels template is nowhere to be found.

    Below is a piece of code taken from the DataViz demo, to illustrate what I mean.

    $("#chart").kendoChart({
                            theme: $(document).data("kendoSkin") || "default",
                            title: {
                                text: "Break-up of Spain Electricity Production for 2008"
                            },
                            legend: {
                                position: "bottom",
                                labels: {
                                    template: "#= text # (#= value #%)"
                                }
                            },

    Any help is greatly appreciated.

    Regards,
    Erwin
  2. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 10 Aug 2012 Link to this post

    Hi Ervin Stam,

    Currently there is no such functionality available. I would suggest to submit your request in Kendo's UserVoice so other members of the community can evaluate, comment on and vote for it.

    Regards,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Jim
    Jim avatar
    5 posts
    Member since:
    Aug 2010

    Posted 22 Oct 2012 Link to this post

    "Currently there is no such functionality available" - is this still true?

    The KendoUI for ASP.NET MVC DataViz examples have a Pie Labels category that seems to work using a Template, but I don't see where "percentage" in the template gets resolved from.  How does one explicitly set the Labels text?
  5. Cecile
    Cecile avatar
    10 posts
    Member since:
    Jul 2010

    Posted 30 May 2013 Link to this post

    Hi,

    In Q1 2013, this feature seems to still be missing. Is there any workaround to change the content of the legend's labels, like for instance a way to apply a client-side template  with javascript ?

    Regards
  6. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 30 May 2013 Link to this post

    Hello Olivier,

    Could you try with legend.labels.template? I am not sure why you can't find this feature.

    Regards,
    Hristo Germanov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready