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

Chart - Horizontal axis hour timestamp

3 Answers 141 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrej
Top achievements
Rank 1
Andrej asked on 22 Aug 2014, 10:23 AM
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!

3 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 27 Aug 2014, 10:58 AM
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.

 
0
Andrej
Top achievements
Rank 1
answered on 28 Aug 2014, 04:01 PM
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.
0
Rosy Topchiyska
Telerik team
answered on 02 Sep 2014, 12:07 PM
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.

 
Tags
Chart
Asked by
Andrej
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Andrej
Top achievements
Rank 1
Share this question
or