Using category label in tooltip

2 posts, 0 answers
  1. Matt
    Matt avatar
    3 posts
    Member since:
    Jun 2012

    Posted 06 May 2016 Link to this post

    I apologize if this has been asked already, but I have looked all over and found nothing. I am looking to see if there is a way to use the category label as a display value in a chart tooltip template. I have tried using the category property, but that really only seems usable in the use of a pie chart. In my case I am using a column chart that is being plotted by date. So when I use category in my tooltip, I get something like this: Tue Mar 01 2016 00:00:00 GMT-0600 (Central Standard Time). I can't just apply a date format to the category, because the charting code we have is being used generically, so the category will not always be a date. I would prefer to be able to just use the label on the category (Mar '16). Is that possible? Or is there some other available property to get the formatted value that is used on the axis? Or some other solution?


    Template code:

    tooltip: {
        visible: true,
        template: "#= # - #= category #: #= value #"
        labels: {
            template: "#= value #"


    Current tooltip

    Total Expenses by Period - Tue Mar 01 2016 00:00:00 GMT-0600 (Central Standard Time): $936,248.35

    Desired tooltip

    Total Expenses by Period - Mar '16: $936,248.35
  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 10 May 2016 Link to this post

    Hi Matt,

    To achieve the expected result you should format the date category in the tooltip template. As an example: 
    tooltip: {
        visible: true,
        template: "#= # - #= kendo.toString(category, 'MMM/yy') #: #= value #"

    Iliana Nikolova
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top