RadHtmlChart TooltipsAppearance DataFormatString with Unix time

Thread is closed for posting
2 posts, 0 answers
  1. Xavier
    Xavier avatar
    2 posts
    Member since:
    Jun 2014

    Posted 06 Jun 2014 Link to this post


    Apparently I can't format my series tooltips to human readable date using DataFormatString.
    I tried {0:d} and many other date formatting but the tooltips always show up as 1399852800000 for example.

    My RadHtmlChart/ScatterLine contain multiple ScatterLineSeries added programmatically. Every item X value are DateTime converted to Unix time.
    My X-Axis has his Type set to date and apparently format correctly with "yyyy-MM-dd".

    Any help?

    Thank you.
  2. Danail Vasilev
    Danail Vasilev avatar
    1476 posts

    Posted 09 Jun 2014 Link to this post

    Hi Xavier,

    You must convert the value to DateTime prior to formatting it. For example:
    <TooltipsAppearance Color="White">
            #= kendo.format(\'{0:d/MM/yyyy}\', new Date(value.x)) #,  #=kendo.format(\'{0:C0}\',value.y)#

    More information on the matter is available in Programmatic Creation Of SeriesItems With DateTime help article.

    Could I also ask you when you open forum threads for the future to choose the right product (i.e., RadHtmlChart control and not RadChart)?

    Thank you for your cooperation.

    Danail Vasilev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top