Chart - Horizontal axis hour timestamp

4 posts, 0 answers
  1. Andrej
    Andrej avatar
    6 posts
    Member since:
    May 2014

    Posted 22 Aug 2014 Link to this post

    Hello,

    I have chart with data values on vertical axis and data timestamps on horizontal axis.

    Data count that is plotted is high, around 300 points. As I stated on previous topic: http://www.telerik.com/forums/chart---question

    data example:
    value = 20, timestamp = 20.08.14. 11:49:30
    value = 15, timestamp = 20.08.14. 11:51:00
    ...
    value = 60, timestamp = 20.08.14. 12:40:00
    ...
    etc.

    So, my question is:

    Is there a way to make labels on horizontal axis like on the picture. I want to have hours time stamps but that are not repeating 50-times for every data plot, but for every first occurance.

    Example:
    value = 20, timestamp = 20.08.14. 11:49:30
    value = 15, timestamp = 20.08.14. 11:51:00
    value = 10, timestamp = 20.08.14. 12:01:00 - HORIZONTAL LABEL "12"
    ...
    value = 60, timestamp = 20.08.14. 12:40:00
    value = 5, timestamp = 20.08.14. 13:00:00 - HORIZONTAL LABEL "13"


    Thanks!
  2. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    551 posts

    Posted 27 Aug 2014 Link to this post

    Hello Andrej,

    Thank you for contacting us.

    I have attached a sample project with two charts to demonstrate how you can use DateTimeContinuousAxis and DateTimeCategoricalAxis to achieve the desired scenario. Here is an article from our online documentation where you can find more information about these two axes: DateTime Axes

    I hope this helps. Please, let us know if you have further questions.

    Regards,
    Rosy Topchiyska
    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.

     
  3. DevCraft banner
  4. Andrej
    Andrej avatar
    6 posts
    Member since:
    May 2014

    Posted 28 Aug 2014 in reply to Rosy Topchiyska Link to this post

    Thank you for your help. I really appreciate your support for your users!

    As you can see on the image attached below, I have managed to get the correct axis I was looking for.

    One thing left:
    Graph started plotting at 17:45 but as you can see on the image it looks like it put my label on the beginning of the graph.. And there is no "45 minutes offset" on the axis. Is there any way to make it (or at least mask it) so the users don't get confused.

    Thank you.
  5. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    551 posts

    Posted 02 Sep 2014 Link to this post

    Hi Andrej,

    If you use a DateTimeContinuousAxis, the problem is that the actual minimum of the axis is not the displayed value in the first label, since this value has been formatted to display only the hour part of the actual minimum. In this case, you can set the axis Minimum property to a proper value.

    I hope this helps.

    Regards,
    Rosy Topchiyska
    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.

     
Back to Top