Graph Label Shows DateTime (Don't Want Time)

2 posts, 0 answers
  1. Phil
    Phil avatar
    45 posts
    Member since:
    Mar 2015

    Posted 11 Mar 2015 Link to this post

    I have created a graph which has a datetime field as the x-axis.  From the datasource, the datatype is datetime. 

    I want the x axis lables to show only MM/dd/yy, but it always wants to show the time.  I have tried custom format on the legend with {0:MM/dd/yy} but that throws an error in the graph saying:  Input string was not in a correct format.  I try without the {} brackets.  Still shows time. 

    I have also tried changing Scale to DateTime Scale (at this point I am shooting in the dark).  Is there a way to get these times to go away?

  2. Stef
    Stef avatar
    3610 posts

    Posted 16 Mar 2015 Link to this post

    Hello Phil,

    If you refer to Telerik Reporting Graph item, by default the axis will use CategoryScale where labels are recognized as strings. To change the formatting in thic case you can work with the CategoryGroups - grouping - Label and place a proper expression formatting the labels.
    Other approach is to switch to DateTime scale and use the axis LabelFormat - How to: Change the Axis Scale.

    Data point labels have their own DataPointLabel settings, which will be applied on individual points in the Graph.

    I hope the information is helpful.


    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.

Back to Top