Add per-hour event counts.
This commit is contained in:
@@ -215,6 +215,7 @@ babyStatsDisplayEventCountSpacer {
|
|||||||
babyStatsDisplayEventCountHeaderTitle {
|
babyStatsDisplayEventCountHeaderTitle {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
text-align: center;
|
||||||
color: rgb(138,155,15);
|
color: rgb(138,155,15);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border-left: 1px solid rgb(233,127,2);
|
border-left: 1px solid rgb(233,127,2);
|
||||||
@@ -228,6 +229,7 @@ babyStatsDisplayEventCountTitle {
|
|||||||
display: table-cell;
|
display: table-cell;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
vertical-align: middle;
|
||||||
color: rgb(73,10,61);
|
color: rgb(73,10,61);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border-top: 1px solid rgb(233,127,2);
|
border-top: 1px solid rgb(233,127,2);
|
||||||
@@ -237,7 +239,9 @@ babyStatsDisplayEventCountValue {
|
|||||||
display: table-cell;
|
display: table-cell;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
color: rgb(189,21,80);
|
color: rgb(189,21,80);
|
||||||
border-top: 1px solid rgb(233,127,2);
|
border-top: 1px solid rgb(233,127,2);
|
||||||
border-left: 1px solid rgb(233,127,2);
|
border-left: 1px solid rgb(233,127,2);
|
||||||
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -795,8 +795,10 @@ BabyStats.prototype.updateDisplayPage_ = function() {
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
cutoffs.forEach(function(cutoff, i) {
|
cutoffs.forEach(function(cutoff, i) {
|
||||||
|
var hours = cutoff[1] / (60 * 60);
|
||||||
|
var perHour = Math.round((counts[i] / hours) * 100) / 100;
|
||||||
this.displayEventCountCells_[tile.type][cutoff[0]].textContent =
|
this.displayEventCountCells_[tile.type][cutoff[0]].textContent =
|
||||||
counts[i];
|
counts[i] + '\n(' + perHour + '/hour)';
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user