This is a migrated thread and some comments may be shown as answers.

Using template for Chart Legend Labels

4 Answers 477 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Erwin
Top achievements
Rank 1
Erwin asked on 10 Aug 2012, 11:03 AM
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

4 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 10 Aug 2012, 11:34 AM
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!
0
Jim
Top achievements
Rank 1
answered on 22 Oct 2012, 02:18 PM
"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?
0
Cecile
Top achievements
Rank 1
answered on 30 May 2013, 10:32 AM
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
0
Hristo Germanov
Telerik team
answered on 30 May 2013, 11:17 AM
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!
Tags
Chart
Asked by
Erwin
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Jim
Top achievements
Rank 1
Cecile
Top achievements
Rank 1
Share this question
or