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

How to set time range on the xAxis properly?

1 Answer 71 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 19 Nov 2013, 05:02 PM
Hi everyone,

I'm having hard times setting up a time axis on my charts and would really appreciate some help. The attached image would be a good starting point. I need to set an exact time range for the xAxis, based on current form data. User selects the required time range, server generates all necessary data and the chart is updated.

 The problem is that I can't set the exact range to be displayed, the range boundaries always snap to hour or day or whatever unit the inner workings find appropriate. When I set the range (min and max values) to say 2013-11-19 07:15:00 and 2013-11-19 18:24:00, respectively, all I seem to get is chart set to 2013-11-19 07:00:00 and 2013-11-19 18:00:00.

This is for me unacceptable - portion of required data is missing from the view and on the other side it looks like there is a gap in the data (since the server generates the data correctly as per user-set time range).

It seems that I'm missing one little piece of the puzzle and I'd be really thankful if somebody could help me out.

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 22 Nov 2013, 10:00 AM
Hi Pavel,

It looks like the dates are grouped in two hours intervals, meaning that although the label says 08:00 the actual time for that point is 7:05. This happens when the baseUnit is set to "fit" and the maxDateGroups is unchanged (default is 10 groups). Here is an example that shows two chart using the same data and different grouping, where similar behavior is observed.
I would recommend you to check this article and tweak the baseUnit, maxDateGroups and autoBaseUnitSteps options for optimal results.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Pavel
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or