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

Line Chart with Date axis

9 Answers 750 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Palanisamy
Top achievements
Rank 1
Palanisamy asked on 25 Dec 2015, 03:47 PM

Hi,

We are using Date axis line chart.We need to display a year data in the x-axis(dates), when we set baseUnit= "days", the labels are getting overlapped. So we have tried changing it to Fit, the kendo script automatically calculates average, there is no overlap in this case,but the points that are getting displayed is not matching the exact data. 

    Pls refer the attached snapshot, my data does not have any value for date 9/20/2015. Can it be made to show the points only for which the data is  available. Or please suggest how can we handle the cases when the data is more than 100.

9 Answers, 1 is accepted

Sort by
0
Vasil Yordanov
Telerik team
answered on 28 Dec 2015, 08:38 AM
Hello Palanisamy,

You can use categoryAxis.labels.step to reduce the number of labels rendered.

In order to control how the chart handles missing values, please refer to the missingValues option.

Here is a dojo with both configurations applied: http://dojo.telerik.com/@yordanov/ONawE


Regards,
Vasil Yordanov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Palanisamy
Top achievements
Rank 1
answered on 10 Jan 2016, 01:38 PM

Hi,

 

We have tried categoryAxis.labels.step ,its working fine with small data  but for huge data tooltip is overlapping.Attached the screen shot for your reference.

 

 

Thanks

Elango

0
Iliana Dyankova
Telerik team
answered on 13 Jan 2016, 07:55 AM
Hi Elango,

This outcome is expected - there are too many data points and tooltip will be rendered for each point. Could you please elaborate a bit more what the expected outcome is?

On a side note, from the provided picture it appears that kendo.common.css and kendo.[theme].css are not included - therefore the tooltip is shrank. For more detailed information on this subject check the corresponding documentation.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Thomas
Top achievements
Rank 1
answered on 03 Mar 2016, 04:28 PM
using categoryAxis.labels.step really helps, but when displaying several months of daily data problems arise.  Attached is a screen shot of 5 and a half months using a step of 30 (data from 9/1/2015 thru 2/16/2016).  While the labels are displayed accurately, they are misleading - the October label appears twice - it appears that there is 60 days worth of October data and there is no label for the last partial month (February).  Is it possible to display the label only on the first day of the month?
0
Iliana Dyankova
Telerik team
answered on 07 Mar 2016, 12:52 PM
Hi Thomas,

I tried to reproduce this outcome but to no avail. Could you please check this dojo and let me know what I am missing?

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Thomas
Top achievements
Rank 1
answered on 11 Mar 2016, 08:47 PM

Hi Iliana,
I looked at the dojo and it looked good, but your data starts toward the end of the month.  If the first date is January 1st, 2015 and the date step is 30, the first date displayed on the axis is 01/2015 (for 1/1/2015), the second date would be 01/2015 (for 1/31/2015) and the third would be 03/2015 (for 3/2/2015 thirty days later completely skipping the 28 days in February).  I modified the date values - attached is a screen shot. 

In another case, if we were starting with Oct 1st, the first date would be 10/year, the second would be 10/year and the third would be 11/year.  while the labels are accurate, the labels appear at the end of the month/span instead of the beginning. 

0
Iliana Dyankova
Telerik team
answered on 15 Mar 2016, 11:37 AM
Hi Thomas,

Thank you for the provided details. I modified the data and believe this outcome is expected when labels step 30 is used. If you wish to display February you could change the step to 31 (updated dojo).

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Dimo
Top achievements
Rank 1
answered on 18 Oct 2020, 09:20 PM

Hi!

How  format categoryAxis.labels for PHP widgets?

0
Tsvetomir
Telerik team
answered on 20 Oct 2020, 01:17 PM

Hi Dimo,

The labels for the category axis of the Kendo UI LineChart for PHP can be modified as follows:

$labels = new \Kendo\Dataviz\UI\ChartCategoryAxisItemLabels();
$labels->format("MM yyyy");

$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->type('date')
            ->labels($labels)
             ->baseUnit("weeks");

 

Kind regards,
Tsvetomir
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Charts
Asked by
Palanisamy
Top achievements
Rank 1
Answers by
Vasil Yordanov
Telerik team
Palanisamy
Top achievements
Rank 1
Iliana Dyankova
Telerik team
Thomas
Top achievements
Rank 1
Dimo
Top achievements
Rank 1
Tsvetomir
Telerik team
Share this question
or