Formatting Dates Not Working As Expected

2 posts, 0 answers
  1. Tyler
    Tyler avatar
    3 posts
    Member since:
    Aug 2016

    Posted 30 Aug Link to this post

    Hey all.

    I have a stored procedure that returns two columns: [dates] and [total]. I have bound a RadHtmlChart to this data as a Line Series. Currently, my tooltip is showing the [Total] properly, however I'd also like it to display the date.

    Doing #=dataItem.dates# returns something along the lines of "Mon Aug 27 2016 12:00:000 Eastern Standard Time", which I would desperately need formatted. I'd prefer "08/29/16" and have tried to achieve it using the following:

    #= kendo.format(\'{0:MM/dd/yy}\', dates) #

    but this results in the tooltips not working at all, which I assume is indicative of a syntax error. Can anyone assist?

    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Layout="stock" DataSourceID="report">
                        <telerik:LineSeries DataFieldY="Total" Name="Combined Total">
                            <LineAppearance LineStyle="Smooth" />
                            <LabelsAppearance Visible="false"></LabelsAppearance>
                                <strong>Combined: </strong>#=dataItem.Total#
                    <XAxis DataLabelsField="dates" Type="Date" BaseUnit="days" BaseUnitStep="1" EnableBaseUnitStepAuto="true">
                        <TitleAppearance Text="Date"></TitleAppearance>
                        <MajorGridLines Visible="true" />
                        <MinorGridLines Visible="false" />
                        <TitleAppearance Text="Declines"></TitleAppearance>
                        <LabelsAppearance DataFormatString="{0}">
  2. Ianko
    Ianko avatar
    1510 posts

    Posted 02 Sep Link to this post

    Hello Tyler,


    You can check out this article here:


    What you are using, although, is the client template of the chart. Which can be formatting with the kendo.toString method. You can check the Kendo documentation for that: And you can read this forum thread for more details and examples about the syntax to use:


    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. Telerik UI for ASP.NET Core is out
Back to Top