X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=web-static%2Fgraphs.html;h=fc30140d7c06393f3954dc1f2f7df13a9362ce05;hb=90b71e52161baab2887da92d44c41c79c99129b9;hp=ad4f1caf62d36b7745296124b3c71188b126181a;hpb=7e823017a508feb861ee05cb163df88cde35b57b;p=p2pool.git diff --git a/web-static/graphs.html b/web-static/graphs.html index ad4f1ca..fc30140 100644 --- a/web-static/graphs.html +++ b/web-static/graphs.html @@ -363,13 +363,17 @@ }); } + periods = ["Hour", "Day", "Week", "Month", "Year"]; + d3.select("#period_chooser").selectAll().data(periods).enter().append("a") + .text(function(period) { return period }) + .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 == "") { + window.location.search = "Day"; + } d3.json('/web/currency_info', function(currency_info) { - periods = ["Hour", "Day", "Week", "Month", "Year"]; - d3.select("#period_chooser").selectAll().data(periods).enter().append("span") - .text(function(period) { return period }) - .on("click", function(period){ change_period(period, currency_info) }) - .attr("style", function(d, i) { return (i == 0 ? "" : "margin-left:.4em;") + "color:blue;text-decoration:underline;cursor:pointer" }); - change_period(periods[1], currency_info); + change_period(period, currency_info); });