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

RadHtmlChart TooltipsAppearance DataFormatString with Unix time

1 Answer 322 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Xavier
Top achievements
Rank 1
Xavier asked on 06 Jun 2014, 07:58 PM
Hi,

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.

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 09 Jun 2014, 11:38 AM
Hi Xavier,

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

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.

Regards,
Danail Vasilev
Telerik
 

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.

 
Tags
Chart (Obsolete)
Asked by
Xavier
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or