-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsecim.html
92 lines (79 loc) · 7.27 KB
/
secim.html
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>secime göre ciz</title>
<link href="layout.css" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery.flot.js"></script>
</head>
<body>
<div id="placeholder" style="width:600px;height:300px;"></div>
<p id="choices">Cizilecekler:</p>
<script type="text/javascript">
$(function () {
var datasets = {
"1": {
label: "1",
data: [[1, Math.floor(Math.random()*10)+1], [2, Math.floor(Math.random()*10)+1], [3, Math.floor(Math.random()*10)+1], [4, Math.floor(Math.random()*10)+1], [5, Math.floor(Math.random()*10)+1], [6, Math.floor(Math.random()*10)+1], [7, Math.floor(Math.random()*10)+1], [8, Math.floor(Math.random()*10)+1], [9, Math.floor(Math.random()*10)+1], [10, Math.floor(Math.random()*10)+1], [11, Math.floor(Math.random()*10)+1], [12, Math.floor(Math.random()*10)+1], [13, Math.floor(Math.random()*10)+1], [14, Math.floor(Math.random()*10)+1], [15, Math.floor(Math.random()*10)+1], [16, Math.floor(Math.random()*10)+1], [17, Math.floor(Math.random()*10)+1], [18, Math.floor(Math.random()*10)+1], [19, Math.floor(Math.random()*10)+1]]
},
"2": {
label: "2",
data: [[1, Math.floor(Math.random()*10)+1], [2, Math.floor(Math.random()*10)+1], [3, Math.floor(Math.random()*10)+1], [4, Math.floor(Math.random()*10)+1], [5, Math.floor(Math.random()*10)+1], [6, Math.floor(Math.random()*10)+1], [7, Math.floor(Math.random()*10)+1], [8, Math.floor(Math.random()*10)+1], [9, Math.floor(Math.random()*10)+1], [10, Math.floor(Math.random()*10)+1], [11, Math.floor(Math.random()*10)+1], [12, Math.floor(Math.random()*10)+1], [13, Math.floor(Math.random()*10)+1], [14, Math.floor(Math.random()*10)+1], [15, Math.floor(Math.random()*10)+1], [16, Math.floor(Math.random()*10)+1], [17, Math.floor(Math.random()*10)+1], [18, Math.floor(Math.random()*10)+1], [19, Math.floor(Math.random()*10)+1]]
},
"3": {
label: "3",
data: [[1, Math.floor(Math.random()*10)+1], [2, Math.floor(Math.random()*10)+1], [3, Math.floor(Math.random()*10)+1], [4, Math.floor(Math.random()*10)+1], [5, Math.floor(Math.random()*10)+1], [6, Math.floor(Math.random()*10)+1], [7, Math.floor(Math.random()*10)+1], [8, Math.floor(Math.random()*10)+1], [9, Math.floor(Math.random()*10)+1], [10, Math.floor(Math.random()*10)+1], [11, Math.floor(Math.random()*10)+1], [12, Math.floor(Math.random()*10)+1], [13, Math.floor(Math.random()*10)+1], [14, Math.floor(Math.random()*10)+1], [15, Math.floor(Math.random()*10)+1], [16, Math.floor(Math.random()*10)+1], [17, Math.floor(Math.random()*10)+1], [18, Math.floor(Math.random()*10)+1], [19, Math.floor(Math.random()*10)+1]]
},
"4": {
label: "4",
data: [[1, Math.floor(Math.random()*10)+1], [2, Math.floor(Math.random()*10)+1], [3, Math.floor(Math.random()*10)+1], [4, Math.floor(Math.random()*10)+1], [5, Math.floor(Math.random()*10)+1], [6, Math.floor(Math.random()*10)+1], [7, Math.floor(Math.random()*10)+1], [8, Math.floor(Math.random()*10)+1], [9, Math.floor(Math.random()*10)+1], [10, Math.floor(Math.random()*10)+1], [11, Math.floor(Math.random()*10)+1], [12, Math.floor(Math.random()*10)+1], [13, Math.floor(Math.random()*10)+1], [14, Math.floor(Math.random()*10)+1], [15, Math.floor(Math.random()*10)+1], [16, Math.floor(Math.random()*10)+1], [17, Math.floor(Math.random()*10)+1], [18, Math.floor(Math.random()*10)+1], [19, Math.floor(Math.random()*10)+1]]
},
"5": {
label: "5",
data: [[1, Math.floor(Math.random()*10)+1], [2, Math.floor(Math.random()*10)+1], [3, Math.floor(Math.random()*10)+1], [4, Math.floor(Math.random()*10)+1], [5, Math.floor(Math.random()*10)+1], [6, Math.floor(Math.random()*10)+1], [7, Math.floor(Math.random()*10)+1], [8, Math.floor(Math.random()*10)+1], [9, Math.floor(Math.random()*10)+1], [10, Math.floor(Math.random()*10)+1], [11, Math.floor(Math.random()*10)+1], [12, Math.floor(Math.random()*10)+1], [13, Math.floor(Math.random()*10)+1], [14, Math.floor(Math.random()*10)+1], [15, Math.floor(Math.random()*10)+1], [16, Math.floor(Math.random()*10)+1], [17, Math.floor(Math.random()*10)+1], [18, Math.floor(Math.random()*10)+1], [19, Math.floor(Math.random()*10)+1]]
},
"6": {
label: "6",
data: [[1, Math.floor(Math.random()*10)+1], [2, Math.floor(Math.random()*10)+1], [3, Math.floor(Math.random()*10)+1], [4, Math.floor(Math.random()*10)+1], [5, Math.floor(Math.random()*10)+1], [6, Math.floor(Math.random()*10)+1], [7, Math.floor(Math.random()*10)+1], [8, Math.floor(Math.random()*10)+1], [9, Math.floor(Math.random()*10)+1], [10, Math.floor(Math.random()*10)+1], [11, Math.floor(Math.random()*10)+1], [12, Math.floor(Math.random()*10)+1], [13, Math.floor(Math.random()*10)+1], [14, Math.floor(Math.random()*10)+1], [15, Math.floor(Math.random()*10)+1], [16, Math.floor(Math.random()*10)+1], [17, Math.floor(Math.random()*10)+1], [18, Math.floor(Math.random()*10)+1], [19, Math.floor(Math.random()*10)+1]]
},
"7": {
label: "7",
data: [[1, Math.floor(Math.random()*10)+1], [2, Math.floor(Math.random()*10)+1], [3, Math.floor(Math.random()*10)+1], [4, Math.floor(Math.random()*10)+1], [5, Math.floor(Math.random()*10)+1], [6, Math.floor(Math.random()*10)+1], [7, Math.floor(Math.random()*10)+1], [8, Math.floor(Math.random()*10)+1], [9, Math.floor(Math.random()*10)+1], [10, Math.floor(Math.random()*10)+1], [11, Math.floor(Math.random()*10)+1], [12, Math.floor(Math.random()*10)+1], [13, Math.floor(Math.random()*10)+1], [14, Math.floor(Math.random()*10)+1], [15, Math.floor(Math.random()*10)+1], [16, Math.floor(Math.random()*10)+1], [17, Math.floor(Math.random()*10)+1], [18, Math.floor(Math.random()*10)+1], [19, Math.floor(Math.random()*10)+1]]
}
};
// hard-code color indices to prevent them from shifting as
// countries are turned on/off
var i = 0;
$.each(datasets, function(key, val) {
val.color = i;
++i;
});
// insert checkboxes
var choiceContainer = $("#choices");
$.each(datasets, function(key, val) {
choiceContainer.append('<br/><input type="checkbox" name="' + key +
'" checked="checked" id="id' + key + '">' +
'<label for="id' + key + '">'
+ val.label + '</label>');
});
choiceContainer.find("input").click(plotAccordingToChoices);
function plotAccordingToChoices() {
var data = [];
choiceContainer.find("input:checked").each(function () {
var key = $(this).attr("name");
if (key && datasets[key])
data.push(datasets[key]);
});
if (data.length > 0)
$.plot($("#placeholder"), data, {
yaxis: { min: 0 },
xaxis: { tickDecimals: 0 }
});
}
plotAccordingToChoices();
});
</script>
</body>
</html>