Show graph labels based on locale
This commit is contained in:
@@ -288,7 +288,12 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
|
||||
var datapoints = data.datapoints.map(function (d) { return parseInt((d[0] / valueDivider).toFixed(2)); });
|
||||
var labels = datapoints.map(function (d, index) {
|
||||
var dateTime = new Date(Date.now() - ((timePeriod - (index * timeBucketSize)) * 60 *1000));
|
||||
return ('0' + dateTime.getHours()).slice(-2) + ':' + ('0' + dateTime.getMinutes()).slice(-2);
|
||||
|
||||
if ($scope.graphs.period > 24) {
|
||||
return dateTime.toLocaleDateString();
|
||||
} else {
|
||||
return dateTime.toLocaleTimeString();
|
||||
}
|
||||
});
|
||||
|
||||
var datasets = [{
|
||||
@@ -328,6 +333,11 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
|
||||
intersect: false
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
ticks: {
|
||||
autoSkipPadding: 20,
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0,
|
||||
|
||||
Reference in New Issue
Block a user