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

Legend ToolTip and Legend Template

7 Answers 511 Views
Charts
This is a migrated thread and some comments may be shown as answers.
merikmgrasp
Top achievements
Rank 1
merikmgrasp asked on 21 Jan 2012, 11:46 PM
Two questions:

  1. Legend tooltips: Is it possible to get a tooltip to appear when mousing over an item in the legend? Basically the same tooltip functionality you provide when mousing over pie slices or bars but for a legend?
  2. Legend template: Is the "template:" feature supported in the legend section? I am trying to format the text displayed in the legend with a function:
    dataSource: {
            transport: {
                read: {
                    url: JsonPath,
                    dataType: "json"
                }
            }
        },
        legend: {
            position: LegendPosition,
            visible: LegendVisible,
            template: "#= FormatLongText(value, 1) #",
            font: '8px Arial'
        },


My FormatLongText() function is NOT called in the "legend" section. Is template not supported in the legend section?

Thanks

7 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 25 Jan 2012, 09:57 AM
Hello Erik Mueller,

Thank you for contacting us.

1. We haven't implement such functionality for the legend.
2. We do not support template for the legend labels. Could you please tell me what value you expect to be in the template?

....
template: "#= FormatLongText(value, 1) #",
....
All the best,
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
merikmgrasp
Top achievements
Rank 1
answered on 26 Jan 2012, 08:09 PM
We have 2 charts for each chart in our system we're building - a small version and a big version. In the case that the user is viewing the small version, I call FormatLongText(value, 10) that basically just does a substring() on your "value" argument with my second argument ("10" in this case). This keeps the small version of the chart clean (for example keeping the first 10 characters instead of all 40 characters that could potentially show in the legend makes the chart render more cleanly). In the case when a user is viewing the big version of the chart (i.e. in a full maximized browser window), I am again calling FormatLongText(value, 40) but passing in a larger max length ("40" in this case). So just substring()'ing legend text based on chart size.

I realize I could do this in SQL/JSON results but was hoping I could do it without editing a bunch of SQL queries or having separate JSON file results to bind to each chart.


0
Hristo Germanov
Telerik team
answered on 31 Jan 2012, 08:44 AM
Hello Erik Mueller,

I will add labels template for the legend of the chart as a feature request in our internal system. If we receive more requests for the same functionality, we will schedule it for investigation.

Kind 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
Gergo
Top achievements
Rank 1
answered on 25 Apr 2012, 10:47 AM
Hi Hristo,

This feature would be very handy to have. We would need this functionality, to customize legends.

Thank you,
Gergő
0
Gergo
Top achievements
Rank 1
answered on 25 Apr 2012, 10:47 AM
Hi Hristo,

This feature would be very handy to have. We would need this functionality, to customize legends.

Thank you,
Gergő
0
Josh
Top achievements
Rank 1
answered on 27 Apr 2012, 01:43 PM
We would also like this feature.
0
Ron DeFreitas
Top achievements
Rank 2
answered on 06 Nov 2012, 08:04 PM
Looks like the templating options is already added per the docs...  but keep in mind it doesn't support html.

http://docs.kendoui.com/api/dataviz/chart#legendlabelstemplate-string
Tags
Charts
Asked by
merikmgrasp
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
merikmgrasp
Top achievements
Rank 1
Gergo
Top achievements
Rank 1
Josh
Top achievements
Rank 1
Ron DeFreitas
Top achievements
Rank 2
Share this question
or