-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathstats-2016-mini.php
72 lines (59 loc) · 8.74 KB
/
stats-2016-mini.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Wiki Loves Monuments statistics</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="wlm.css" />
<script language="javascript" type="text/javascript" src="modules/jquery.js"></script>
<script language="javascript" type="text/javascript" src="modules/jquery.flot.js"></script>
</head>
<body style="background-color: white;">
<div id="dates_graph" style="width: 300px;height: 150px;"></div>
<script type="text/javascript">
$(function () {
var dates_graph_data_2016 = [["1196467200000", 1], ["1410739200000", 3], ["1411776000000", 1], ["1464134400000", 1], ["1464480000000", 5], ["1464825600000", 1], ["1466553600000", 1], ["1466726400000", 1], ["1467331200000", 1], ["1468972800000", 2], ["1469059200000", 1], ["1472342400000", 1], ["1472515200000", 4], ["1472601600000", 366], ["1472688000000", 5186], ["1472774400000", 8843], ["1472860800000", 8761], ["1472947200000", 8692], ["1473033600000", 5317], ["1473120000000", 5566], ["1473206400000", 5170], ["1473292800000", 6194], ["1473379200000", 6457], ["1473465600000", 6651], ["1473552000000", 5755], ["1473638400000", 5489], ["1473724800000", 4624], ["1473811200000", 4646], ["1473897600000", 6145], ["1473984000000", 6088], ["1474070400000", 5743], ["1474156800000", 8296], ["1474243200000", 6190], ["1474329600000", 7984], ["1474416000000", 6831], ["1474502400000", 6762], ["1474588800000", 7349], ["1474675200000", 7602], ["1474761600000", 9439], ["1474848000000", 11593], ["1474934400000", 12296], ["1475020800000", 13948], ["1475107200000", 23689], ["1475193600000", 32638], ["1475280000000", 2618], ["1475366400000", 671], ["1475452800000", 828], ["1475539200000", 1368], ["1475625600000", 1281], ["1475712000000", 1823], ["1475798400000", 333], ["1475884800000", 357], ["1475971200000", 486], ["1476057600000", 226], ["1476144000000", 71], ["1476230400000", 252], ["1476316800000", 158], ["1476403200000", 458], ["1476489600000", 751], ["1476576000000", 645], ["1476662400000", 162], ["1476748800000", 248], ["1476835200000", 74], ["1476921600000", 36], ["1477008000000", 349], ["1477094400000", 566], ["1477180800000", 192], ["1477267200000", 625], ["1477353600000", 563], ["1477440000000", 106], ["1477526400000", 269], ["1477612800000", 137], ["1477699200000", 406], ["1477785600000", 419], ["1477872000000", 420], ["1477958400000", 181], ["1478908800000", 1], ["1479945600000", 1], ["1480204800000", 34], ["1482105600000", 1]];
var dates_graph_data_2015 = [["1472601600000", 852], ["1472688000000", 6981], ["1472774400000", 6028], ["1472860800000", 6519], ["1472947200000", 7189], ["1473033600000", 5689], ["1473120000000", 6726], ["1473206400000", 4823], ["1473292800000", 3824], ["1473379200000", 4276], ["1473465600000", 3521], ["1473552000000", 4177], ["1473638400000", 5003], ["1473724800000", 6793], ["1473811200000", 4989], ["1473897600000", 5869], ["1473984000000", 4800], ["1474070400000", 4802], ["1474156800000", 4393], ["1474243200000", 5661], ["1474329600000", 7025], ["1474416000000", 8293], ["1474502400000", 7860], ["1474588800000", 6899], ["1474675200000", 7749], ["1474761600000", 6534], ["1474848000000", 7894], ["1474934400000", 10949], ["1475020800000", 14017], ["1475107200000", 15320], ["1475193600000", 22803], ["1475280000000", 825]];
var dates_graph_data_2014 = [["1472601600000", 837], ["1472688000000", 10066], ["1472774400000", 6531], ["1472860800000", 6595], ["1472947200000", 5285], ["1473033600000", 5430], ["1473120000000", 6534], ["1473206400000", 6925], ["1473292800000", 5187], ["1473379200000", 4659], ["1473465600000", 5070], ["1473552000000", 4157], ["1473638400000", 5416], ["1473724800000", 5198], ["1473811200000", 6586], ["1473897600000", 6604], ["1473984000000", 7280], ["1474070400000", 7816], ["1474156800000", 5855], ["1474243200000", 5128], ["1474329600000", 6786], ["1474416000000", 7939], ["1474502400000", 7570], ["1474588800000", 7779], ["1474675200000", 6979], ["1474761600000", 8705], ["1474848000000", 9844], ["1474934400000", 10181], ["1475020800000", 12936], ["1475107200000", 16419], ["1475193600000", 24490], ["1475280000000", 2690]];
var dates_graph_data_2013 = [["1472601600000", 409], ["1472688000000", 14345], ["1472774400000", 8265], ["1472860800000", 9208], ["1472947200000", 8663], ["1473033600000", 7886], ["1473120000000", 8220], ["1473206400000", 8453], ["1473292800000", 9373], ["1473379200000", 9606], ["1473465600000", 8279], ["1473552000000", 9629], ["1473638400000", 7791], ["1473724800000", 8388], ["1473811200000", 8160], ["1473897600000", 9568], ["1473984000000", 8790], ["1474070400000", 9468], ["1474156800000", 8790], ["1474243200000", 8381], ["1474329600000", 8992], ["1474416000000", 10009], ["1474502400000", 12367], ["1474588800000", 9869], ["1474675200000", 13156], ["1474761600000", 14209], ["1474848000000", 15964], ["1474934400000", 15085], ["1475020800000", 19514], ["1475107200000", 33069], ["1475193600000", 41951], ["1475280000000", 3711]];
var dates_graph_data_2012 = [["1472601600000", 525], ["1472688000000", 7641], ["1472774400000", 8638], ["1472860800000", 6954], ["1472947200000", 7276], ["1473033600000", 7946], ["1473120000000", 6513], ["1473206400000", 7268], ["1473292800000", 8386], ["1473379200000", 10372], ["1473465600000", 10613], ["1473552000000", 8214], ["1473638400000", 8694], ["1473724800000", 9046], ["1473811200000", 8725], ["1473897600000", 8627], ["1473984000000", 11119], ["1474070400000", 9520], ["1474156800000", 8408], ["1474243200000", 7387], ["1474329600000", 8284], ["1474416000000", 10391], ["1474502400000", 10656], ["1474588800000", 14308], ["1474675200000", 11642], ["1474761600000", 12848], ["1474848000000", 13158], ["1474934400000", 17252], ["1475020800000", 20409], ["1475107200000", 26966], ["1475193600000", 47387], ["1475280000000", 5554]];
var dates_graph_data_2011 = [["1472601600000", 222], ["1472688000000", 2373], ["1472774400000", 1560], ["1472860800000", 2211], ["1472947200000", 3473], ["1473033600000", 3333], ["1473120000000", 2968], ["1473206400000", 3050], ["1473292800000", 2850], ["1473379200000", 3146], ["1473465600000", 3546], ["1473552000000", 4306], ["1473638400000", 4069], ["1473724800000", 3755], ["1473811200000", 3378], ["1473897600000", 4762], ["1473984000000", 3596], ["1474070400000", 4648], ["1474156800000", 7038], ["1474243200000", 5095], ["1474329600000", 4185], ["1474416000000", 4669], ["1474502400000", 4390], ["1474588800000", 4807], ["1474675200000", 6123], ["1474761600000", 8159], ["1474848000000", 6691], ["1474934400000", 9158], ["1475020800000", 10408], ["1475107200000", 13188], ["1475193600000", 21971], ["1475280000000", 927]];
var dates_graph = $("#dates_graph");
var dates_graph_data = [{ data: dates_graph_data_2016, label: "2016"}, { data: dates_graph_data_2015, label: "2015"}, { data: dates_graph_data_2014, label: "2014"}, { data: dates_graph_data_2013, label: "2013"}, { data: dates_graph_data_2012, label: "2012"}, { data: dates_graph_data_2011, label: "2011"}];
var dates_graph_options = { xaxis: { mode: "time", min: (new Date("2016/08/31")).getTime(), max: (new Date("2016/10/01")).getTime() }, lines: { show: true }, points: { show: true }, legend: { noColumns: 6, position: "nw" }, grid: { hoverable: true }, clickable: true, hoverable: true };
$.plot(dates_graph, dates_graph_data, dates_graph_options);
});
//from http://people.iola.dk/olau/flot/examples/interacting.html
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
position: 'absolute',
display: 'none',
top: y + 5,
left: x + 12,
border: '1px solid #fdd',
padding: '2px',
'background-color': '#fee',
opacity: 0.80
}).appendTo("body").fadeIn(200);
}
var previousPoint = null;
$("#dates_graph").bind("plothover", function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint != item.datapoint) {
previousPoint = item.datapoint;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY,
"y = "+Math.round(y));
}
} else {
$("#tooltip").remove();
previousPoint = null;
}
});
</script>
</body>
</html>