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

Line chart categoryAxis baseUnit with date range issues

3 Answers 248 Views
Charts
This is a migrated thread and some comments may be shown as answers.
DVS InteleStream
Top achievements
Rank 1
DVS InteleStream asked on 01 Apr 2016, 01:44 AM

Hello,

In experimenting with line chart and differing date ranges have run into a couple discrepancies.  Outlined below with examples.

Issue 1
With ‘roundToBaseUnit’ set to true (default behavior) it looks like the weeks always start on Sundays.  You can see the middle week in the example is adding data for both Sundays, so 8 days total, while the 3rd week in the example (starting on the 20th) does not take Sunday the 20th data into its total.

http://jsbin.com/yejage/9/edit

Issue 2
When you set ‘roundToBaseUnit’ to false, it looks like the chart gets cutoff according the remainder of the base unit.  In the example, since there is less than a half week for the third data point, you aren’t even able to see the third data point.  We are looking for the ability to have weeks that don't always start on Sunday, but instead the first day of the date range, which is why we're setting this option to false.

http://jsbin.com/yejage/11/edit

Issue 3
With ‘baseUnitStep’ set to “auto” it is possible to display one more date group than is set in ‘maxDateGroups.’  For instance, in the example, maxDateGroups is set to 5 and you can see 6 date groups are displaying.

Note: To view example 3 properly you will need to change the version of Kendo that is loaded to be the most recent internal build (2016.1.322).  The example is referencing 2016.1.226.

http://jsbin.com/yejage/13/edit

 

Machine used for testing is on PDT.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 05 Apr 2016, 07:43 AM
Hello,

Thank you for the examples. I reproduced the first and the third issues and we will look into them.
As for the second issue - if the roundToBaseUnit option is set to false then the axis will display the exact range but the points are always displayed in the middle of the category for categorical charts. I can suggest either to set the axis max value based on the range of the data or use scatterLine chart with date axis instead of line chart.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
DVS InteleStream
Top achievements
Rank 1
answered on 07 Apr 2016, 10:39 PM

Thank you re: Issue 1 & 3.

Re: Issue 2

I'd like to avoid using the scatterLine chart because it looks like we would need to include the date for each separate series.  So, if we had three series, we would be sending the same date three times in the data, to correspond to each series.  This seems like unnecessary duplication.  Let me know if I'm misreading this.

Setting the min or max value may work - though in trying that it looks like the graph will still plot data at "0" for points which there are no data.  See attached jsbin - the point for March 27th is being plotted at 0.  I also tried setting the value to "null" but it was still being plotted at 0.

http://jsbin.com/yejage/14/edit

So, if we're using axis max to show the full range of data, is there a way to avoid having extraneous points being plotted at 0?

Thanks for your help.

0
Daniel
Telerik team
answered on 12 Apr 2016, 07:18 AM
Hi again,

Zero will be plotted because of the sum aggregate. You can use the sumOrNull aggregate in order to avoid this.

I am not sure if I understand the question about the date being included when using scatterLine but yes, the xAxis for scatter series does not support option like the categoryAxis categories.

Regards,
Daniel
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
DVS InteleStream
Top achievements
Rank 1
Answers by
Daniel
Telerik team
DVS InteleStream
Top achievements
Rank 1
Share this question
or