Code simplification, more chart layout cleanup.
This commit is contained in:
@@ -955,49 +955,7 @@ BabyStats.prototype.updateDisplayPage_ = function() {
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.weightChart_.draw(this.weightTable_, {
|
var chartOptions = {
|
||||||
title: 'Weight',
|
|
||||||
curveType: 'function',
|
|
||||||
legend: {
|
|
||||||
position: 'none',
|
|
||||||
},
|
|
||||||
hAxis: {
|
|
||||||
gridlines: {
|
|
||||||
color: '#E97F02',
|
|
||||||
},
|
|
||||||
textStyle: {
|
|
||||||
color: '#8A9B0F',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
vAxis: {
|
|
||||||
gridlines: {
|
|
||||||
color: '#E97F02',
|
|
||||||
},
|
|
||||||
textStyle: {
|
|
||||||
color: '#490A3D',
|
|
||||||
},
|
|
||||||
title: 'Kilograms',
|
|
||||||
titleTextStyle: {
|
|
||||||
color: '#490A3D',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
titleTextStyle: {
|
|
||||||
color: '#8A9B0F',
|
|
||||||
fontSize: 20,
|
|
||||||
},
|
|
||||||
explorer: {
|
|
||||||
actions: [
|
|
||||||
'dragToZoom',
|
|
||||||
'rightClickToReset',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
colors: [
|
|
||||||
'#BD1550',
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
this.tempChart_.draw(this.tempTable_, {
|
|
||||||
title: 'Temperature (last 7 days)',
|
|
||||||
curveType: 'function',
|
curveType: 'function',
|
||||||
legend: {
|
legend: {
|
||||||
position: 'none',
|
position: 'none',
|
||||||
@@ -1010,7 +968,6 @@ BabyStats.prototype.updateDisplayPage_ = function() {
|
|||||||
color: '#8A9B0F',
|
color: '#8A9B0F',
|
||||||
},
|
},
|
||||||
viewWindow: {
|
viewWindow: {
|
||||||
min: new Date((now - (60 * 60 * 24 * 7)) * 1000),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
vAxis: {
|
vAxis: {
|
||||||
@@ -1020,14 +977,14 @@ BabyStats.prototype.updateDisplayPage_ = function() {
|
|||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#490A3D',
|
color: '#490A3D',
|
||||||
},
|
},
|
||||||
title: '° Celsius',
|
|
||||||
titleTextStyle: {
|
titleTextStyle: {
|
||||||
|
fontSize: 17,
|
||||||
color: '#490A3D',
|
color: '#490A3D',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
titleTextStyle: {
|
titleTextStyle: {
|
||||||
fontSize: 20,
|
|
||||||
color: '#8A9B0F',
|
color: '#8A9B0F',
|
||||||
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
explorer: {
|
explorer: {
|
||||||
actions: [
|
actions: [
|
||||||
@@ -1038,7 +995,23 @@ BabyStats.prototype.updateDisplayPage_ = function() {
|
|||||||
colors: [
|
colors: [
|
||||||
'#BD1550',
|
'#BD1550',
|
||||||
],
|
],
|
||||||
});
|
};
|
||||||
|
|
||||||
|
var weightOptions = {
|
||||||
|
title: 'Weight',
|
||||||
|
};
|
||||||
|
Object.assign(weightOptions, chartOptions);
|
||||||
|
weightOptions.vAxis.title = 'Kilograms';
|
||||||
|
this.weightChart_.draw(this.weightTable_, weightOptions);
|
||||||
|
|
||||||
|
var tempOptions = {
|
||||||
|
title: 'Temperature (last 7 days)',
|
||||||
|
};
|
||||||
|
Object.assign(tempOptions, chartOptions);
|
||||||
|
tempOptions.vAxis.title = '° Celsius';
|
||||||
|
tempOptions.hAxis.viewWindow.min =
|
||||||
|
new Date((now - (60 * 60 * 24 * 7)) * 1000);
|
||||||
|
this.tempChart_.draw(this.tempTable_, tempOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user