fix(server/views/account): Change default text of heatmap legend

The default text of the legend is confusing given the low range of
values used. Cal-heatmap expects higher legend values, such as [10, 20,
30, 40], rather than [1, 2, 3]. This change will hopefully make the
mouseover text for the legend a little less confusing.

BREAKING CHANGE: None

Closes #16124
pull/16132/head
scissorsneedfoodtoo 2017-11-29 20:40:04 +09:00
parent 69fa4b3098
commit 924e7f19d6
1 changed files with 5 additions and 0 deletions

View File

@ -70,6 +70,8 @@ block content
$(document).ready(function () {
var cal = new CalHeatMap();
var calendar = !{JSON.stringify(calender)};
var rectSelector = "#cal-heatmap > svg > svg.graph-legend > g > rect.r";
var calLegendTitles = ["0 items", "1 item", "2 items", "3 or more items"]
cal.init({
itemSelector: "#cal-heatmap",
domain: "month",
@ -89,6 +91,9 @@ block content
position: "top"
}
});
calLegendTitles.forEach(function(title, i) {
document.querySelector(rectSelector + (i + 1).toString() + '> title').innerHTML = title;
});
});
.row
.hidden-xs.col-sm-12.text-center