I am using nvd3 chart in my angular application. I am getting the labels in below format
["14:49", "14:58", "14:57", "14:56", "14:55", "14:54", "14:53", "14:52", "14:51"]
I have to sort them based on time.This is my code
var hourMin = new Date($scope.items[i].timestamp);
$scope.labels[i] = hourMin.getHours() + ":" + hourMin.getMinutes();
HTML :
<canvas id="line" class="chart chart-line" chart-data="data"
chart-labels="labels" chart-legend="true" chart-series="series"
chart-click="onClick" >
</canvas>
I have tried orderBy but it is not working. Help me.