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

Strange results with baseUnit fit

1 Answer 56 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Michaël
Top achievements
Rank 1
Michaël asked on 30 Dec 2014, 11:11 PM
Hi,

I'm trying to take advantage of the "baseUnit" property, but while it works as expected in many cases, it fails in some other, and I can't explain myself why. I have an interval selector that allows to select hour, day, week, month or year interval. In some cases, if my date are 1st January, 1st February, 1st March, 1st April, 1st May, and select baseUnit=fit with a maxDateGroup of 24, then it will decide to render as week, hence rendering some dates with a value of 0 (as I don't have data in those points).

How does the algorithm work exactly? For now, I'm forced to explicitly pass the selected interval to kendo, but the problem is that when the interval is explictly set, maxDateGroups no longer work! Is there a way to use maxDateGroups with other step than fit?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 01 Jan 2015, 05:43 PM
Hello,

The automatic base unit selection uses the autoBaseUnitSteps values as a guideline.

The chart will try to divide the active period into successively larger intervals.
It will start from x-second intervals, where x is picked from the autoBaseUnitSteps.seconds array.

If that results in less than maxDateGroups intervals then we're done, otherwise it'll move to minutes, hours and so on.

You can change the default arrays to fine tune this behavior.
For example, you can disable weeks entirely:
autoBaseUnitSteps: {
  weeks: []
}


Happy New Year!

Regards,
T. Tsonev
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
Michaël
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or