CAML ordering not working in Chrome

It appears ordering is not working in chrome, but ok on IE and firefox.

The following is my caml

    <FieldRef Name="Municipality"/>
    <FieldRef Name="Population"/>
    <FieldRef Name="DwellingUnits"/>
    <FieldRef Name="Employment"/>
    <FieldRef Name="Date"/>
          <FieldRef Name="Date" Ascending='True'/>
      <Aggregations Value="Off"/>
      <RowLimit Paged="TRUE">1000</RowLimit>

I have date rate from 1991 - 2040 on 1 year increments.

Data output from firefox and IE has the right sequence and starts from 1991, 1992, 1993 etc… 2040

Data output from Chrome is a little random: 2016, 1991, 1993, …1992…2000, 2001…

How can I make it sort properly for chrome?

I solved this by adding a sort function in dashboard preRender

 var data = config.series[0].data;
  data.sort(function(a, b) {
      return a.Date - b.Date;

Please let me know if there’s a more efficient way.


This seems to be a problem on Chrome’s end (the sorting algorithm is implemented incorrectly):

Your workaround is correct.