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

why Dates in categoryAxis are shuffled?

9 Answers 105 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Ilyas
Top achievements
Rank 1
Ilyas asked on 10 May 2012, 10:01 AM
Hi,

I'm having dates coming from JSON datasource and are being set as categoryAxis, but they get shuffled automatically, i.e; somehow the middle date is showing as the first field and vice versa. Please find the attached screenshot for detail.
I don'nt konw why is it happening, Please help!

9 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 11 May 2012, 01:37 PM
Hi Ilyas,

I tried to reproduce your scenario, but to no avail. Could you please send a simple test project which reproduces the depicted issue? Thus I will be able to observe the problem and advice you further.

Greetings,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Raido Valgeväli
Top achievements
Rank 2
answered on 14 May 2013, 03:17 PM
I have a similar issue, sample here:
http://70.43.83.4/test/html5/kendos.html
0
Iliana Dyankova
Telerik team
answered on 15 May 2013, 09:05 AM
Hello Raido,

I believe the reason for this issue is that "start_date_time" field contains strings instead of date (even in the source of the page the dataSource's schema is commented). Please ensure the passed data is with type date and let me know if you still observe any problems.
 
Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Raido Valgeväli
Top achievements
Rank 2
answered on 15 May 2013, 09:15 AM
Hi Iliana 

The dates are actually recognized and converted fine by the framework (I also un-commented the schema).
They are automatically formatted as dates on the axis.. should be a proof.
Also they work nicely on other types of charts. I still believe this is a bug in rendering.

 Raido

0
Iliana Dyankova
Telerik team
answered on 16 May 2013, 03:02 PM
Hi Raido,

I examined the source of the provided page and observed that in the Chart's configuration you set justified: false for the xAxis. Please note this is not a valid option for the scatterLine Chart - hence in order to get correct rendering you should remove it.
 
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Raido Valgeväli
Top achievements
Rank 2
answered on 20 May 2013, 04:50 PM
Is it documented (couldn't find)? Rendering gets correct indeed. 
Thanks.
Raido
0
Iliana Dyankova
Telerik team
answered on 20 May 2013, 06:35 PM
Hi Raido,

As shown in the corresponding documentation, the justified configuration option is available only for the categoryAxis. 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
osman
Top achievements
Rank 1
answered on 04 Jun 2013, 02:28 PM
categoryAxis: {
labels:
{
rotation: -90,
dateFormats:
{
minutes: "HH:mm",
hours: "HH:mm",
days: "dd/MM",
months: "MMM 'yy",
years: "yyyy"
}
}, type: "Date", baseUnit: "weeks",

categories: ["2012-11-14","2012-11-15","2012-11-16","2012-11-17","2012-11-18","2012-11-19","2012-11-20","2012-11-21","2012-11-22","2012-11-23","2012-11-24","2012-11-25","2012-11-26","2012-11-27","2012-11-28","2012-11-29"] } 

how can change baseUnit dynamically ? 
var chart=$("#linechart").data("kendoChart");
 chart.Options.categoryAxis.baseUnit="day";
 chart.redraw();
is there any way reach it then change ? "chart.Options.categoryAxis.baseUnit"   ??
0
Iliana Dyankova
Telerik team
answered on 06 Jun 2013, 01:15 PM
Hello Osman,

Generally speaking your approach is correct, however there is a spelling mistake - the correct one is chart.options (lower case). I.e.:
var chart=$("#linechart").data("kendoChart");
chart.options.categoryAxis.baseUnit="day";
chart.redraw();

Regards,

Iliana Nikolova
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
Ilyas
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Raido Valgeväli
Top achievements
Rank 2
osman
Top achievements
Rank 1
Share this question
or