Legend ToolTip and Legend Template

8 posts, 0 answers
  1. merikmgrasp
    merikmgrasp avatar
    2 posts
    Member since:
    May 2007

    Posted 21 Jan 2012 Link to this post

    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
  2. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 25 Jan 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. merikmgrasp
    merikmgrasp avatar
    2 posts
    Member since:
    May 2007

    Posted 26 Jan 2012 Link to this post

    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.


  5. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 31 Jan 2012 Link to this post

    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!
  6. Gergo
    Gergo avatar
    20 posts
    Member since:
    Mar 2012

    Posted 25 Apr 2012 Link to this post

    Hi Hristo,

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

    Thank you,
    Gergő
  7. Gergo
    Gergo avatar
    20 posts
    Member since:
    Mar 2012

    Posted 25 Apr 2012 Link to this post

    Hi Hristo,

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

    Thank you,
    Gergő
  8. Josh
    Josh avatar
    4 posts
    Member since:
    Feb 2011

    Posted 27 Apr 2012 Link to this post

    We would also like this feature.
  9. Ron DeFreitas
    Ron DeFreitas avatar
    26 posts
    Member since:
    Apr 2010

    Posted 06 Nov 2012 Link to this post

    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
Back to Top
Kendo UI is VS 2017 Ready