why Dates in categoryAxis are shuffled?

10 posts, 0 answers
  1. Ilyas
    Ilyas avatar
    6 posts
    Member since:
    Dec 2011

    Posted 10 May 2012 Link to this post

    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!
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 11 May 2012 Link to this post

    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!
  3. Raido Valgeväli
    Raido Valgeväli avatar
    26 posts
    Member since:
    May 2008

    Posted 14 May 2013 Link to this post

    I have a similar issue, sample here:
    http://70.43.83.4/test/html5/kendos.html
  4. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 15 May 2013 Link to this post

    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!
  5. Raido Valgeväli
    Raido Valgeväli avatar
    26 posts
    Member since:
    May 2008

    Posted 15 May 2013 Link to this post

    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

  6. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 16 May 2013 Link to this post

    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!
  7. Raido Valgeväli
    Raido Valgeväli avatar
    26 posts
    Member since:
    May 2008

    Posted 20 May 2013 Link to this post

    Is it documented (couldn't find)? Rendering gets correct indeed. 
    Thanks.
    Raido
  8. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 20 May 2013 Link to this post

    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!
  9. osman
    osman avatar
    19 posts
    Member since:
    May 2013

    Posted 04 Jun 2013 Link to this post

    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"   ??
  10. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 06 Jun 2013 Link to this post

    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!
Back to Top