Fix graph.
This commit is contained in:
parent
4be249d67d
commit
ea58e93f20
@ -383,7 +383,7 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
|||||||
var lastDate = moment(entries[entries.length - 1][0]).add(1, 'day').format();
|
var lastDate = moment(entries[entries.length - 1][0]).add(1, 'day').format();
|
||||||
|
|
||||||
var chart = nv.models.lineChart().options({
|
var chart = nv.models.lineChart().options({
|
||||||
x: function(d) { return d3.time.format.utc(d[0]); },
|
x: function(d) { return new Date(d[0]); },
|
||||||
y: function(d) { return new Number(d[1]); },
|
y: function(d) { return new Number(d[1]); },
|
||||||
transitionDuration: 250,
|
transitionDuration: 250,
|
||||||
showXAxis: true,
|
showXAxis: true,
|
||||||
@ -397,7 +397,7 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
|||||||
chart.xAxis
|
chart.xAxis
|
||||||
.axisLabel("Date")
|
.axisLabel("Date")
|
||||||
.tickFormat(function(d) {
|
.tickFormat(function(d) {
|
||||||
return d3.time.format.iso(new Date(d));
|
return d3.time.format("%x")(new Date(d));
|
||||||
});
|
});
|
||||||
//chart.xAxis.scale().range([firstDate, lastDate]);
|
//chart.xAxis.scale().range([firstDate, lastDate]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user