Inverted order of values in datetime based category chart

3 posts, 0 answers
  1. Holger
    Holger avatar
    77 posts
    Member since:
    Nov 2012

    Posted 11 Mar 2014 Link to this post

    Hi,

    I'm experiencing a problem with Kendo UI Chart using datetime based category axis. The chart inverts the order of the values given by the datasource.

    Maybe it's an issue with UTC timestamps? To reproduce the problem please have a look to the following plunker: http://plnkr.co/v7LUFkESnYVGSzKijGuU

    Thanks,
    Holger
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 12 Mar 2014 Link to this post

    Hello,

    The Chart will always arrange date values in chronological order. You can set the reverse option to true to get them in reverse order.

    categoryAxis: {
      reverse: true
      ...
    }

    -- Live demo --

    This has the side effect of moving the value axis to the right which is not desirable in this case.
    We'll look into this issue to determine if this behavior is desirable at all. It can be overridden in the following way:
    categoryAxis: {
      reverse: true,
      axisCrossingValue: Number.MAX_VALUE
    }

    This moves the value axis crossing point to the last category. MAX_VALUE is used as a placeholder as the last category index.

    Alternatively, you can switch the axis type back to "categorical" which will preserve the original order.
    categoryAxis: {
        type: "categorical"
        ...
    }


    --- Live demo ---

    I hope this helps.

    Regards,
    T. Tsonev
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. Kendo UI is VS 2017 Ready
  4. Holger
    Holger avatar
    77 posts
    Member since:
    Nov 2012

    Posted 12 Mar 2014 in reply to T. Tsonev Link to this post

    Thank you very much for your help.

    Both alternatives seem to work well, I will check which one fits best.

    It would be great if the chronological order of datetime based values in the chart could be disabled by option.

    Thanks,
    Holger
Back to Top