.attr('href', function(period){ return "?" + period })
.attr("style", function(d, i) { return (i == 0 ? "" : "margin-left:.4em;") + "color:blue;text-decoration:underline;cursor:pointer" });
period = window.location.search.substr(1);
- if(period == "") {
+ if(period.length < 3) {
window.location.search = "Day";
+ } else {
+ d3.json('/web/currency_info', function(currency_info) {
+ change_period(period, currency_info);
+ });
}
- d3.json('/web/currency_info', function(currency_info) {
- change_period(period, currency_info);
- });
</script>
</body>
</html>