3

I'm using KendoUI DataViz Chart to show the statistical data and 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! enter image description here

kmp
  • 10,535
  • 11
  • 75
  • 125
Edge
  • 901
  • 1
  • 12
  • 19

2 Answers2

3

I think that you hit the problem with the stable sort in Chrome :). This problem is fixed with the Q2 2012 SP1 release of the Kendo UI.

Community
  • 1
  • 1
gudman
  • 141
  • 5
0

I believe the Kendo UI Charts are looking for a unix time stamp. Try formatting a couple of your values as a time stamp and then using a template to format the date like this:

categoryAxis: {
    labels: {
        template: "#= formatDate(value) #"
    }
}

The formatDate will be a function that you define that can produce the string you want displayed in the axis.

I think this approach will allow kendo to order your dates correctly AND give you the format you are looking for.

BentOnCoding
  • 27,307
  • 14
  • 64
  • 92