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

Inverted order of values in datetime based category chart

2 Answers 128 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Holger
Top achievements
Rank 1
Holger asked on 11 Mar 2014, 03:45 PM
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 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 12 Mar 2014, 11:42 AM
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.

 
0
Holger
Top achievements
Rank 1
answered on 12 Mar 2014, 01:40 PM
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
Tags
Charts
Asked by
Holger
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Holger
Top achievements
Rank 1
Share this question
or