1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
---|
2 | <html>
|
---|
3 | <head>
|
---|
4 | <link type="text/css" rel="stylesheet" href="Module/src/css/jscal2.css" />
|
---|
5 | <link type="text/css" rel="stylesheet" href="Module/src/css/border-radius.css" />
|
---|
6 |
|
---|
7 | <link id="skin-win2k" title="Win 2K" type="text/css" rel="alternate stylesheet" href="Module/src/css/win2k/win2k.css" />
|
---|
8 | <script src="js/jquery-1.7.2.min.js"></script>
|
---|
9 | <script src="js/highcharts.js"></script>
|
---|
10 | <script src="js/exporting.js"></script>
|
---|
11 |
|
---|
12 | <script src="Module/src/js/jscal2.js"></script>
|
---|
13 | <script src="Module/src/js/unicode-letter.js"></script>
|
---|
14 |
|
---|
15 | <script src="Module/src/js/lang/en.js"></script>
|
---|
16 | <style type="text/css">
|
---|
17 | .highlight { color: #f00 !important; }
|
---|
18 | .highlight2 { color: #0f0 !important; font-weight: bold; }
|
---|
19 | </style>
|
---|
20 |
|
---|
21 | </head>
|
---|
22 | <body style="background-color: #fff">
|
---|
23 |
|
---|
24 | <table>
|
---|
25 | <tr>
|
---|
26 | <td valign="top" style="width: 30em;">
|
---|
27 | <div id="cont"></div>
|
---|
28 | <script type="text/javascript">
|
---|
29 | var DATE_INFO = {
|
---|
30 | 20130507: { klass: "highlight", tooltip: "%Y/%m/%d (%A)<br />That was yesterday" },
|
---|
31 | 20130508: { klass: "highlight", tooltip: "And this is TODAY" }
|
---|
32 | };
|
---|
33 |
|
---|
34 | function getDateInfo(date, wantsClassName) {
|
---|
35 | var as_number = Calendar.dateToInt(date);
|
---|
36 | return DATE_INFO[as_number];
|
---|
37 | };
|
---|
38 | var CAL = Calendar.setup({
|
---|
39 | cont: "cont",
|
---|
40 | // weekNumbers: true,
|
---|
41 | selectionType: Calendar.SEL_MULTIPLE,
|
---|
42 | showTime: 24,
|
---|
43 | //fdow : 1,
|
---|
44 | dateInfo:getDateInfo
|
---|
45 | // titleFormat: "%B %Y"
|
---|
46 | })
|
---|
47 | </script>
|
---|
48 | </td>
|
---|
49 |
|
---|
50 | <tr>
|
---|
51 | <td>
|
---|
52 | <script type="text/javascript">//<![CDATA[
|
---|
53 |
|
---|
54 | CAL.addEventListener("onSelect", function(){
|
---|
55 | var day =this.selection.print("%d").join("\n");
|
---|
56 | var month =this.selection.print("%m").join("\n");
|
---|
57 | var year =this.selection.print("%Y").join("\n");
|
---|
58 |
|
---|
59 | var xmlhttp;
|
---|
60 | if (window.XMLHttpRequest)
|
---|
61 | {// code for IE7+, Firefox, Chrome, Opera, Safari
|
---|
62 | xmlhttp=new XMLHttpRequest();
|
---|
63 | }
|
---|
64 | else
|
---|
65 | {// code for IE6, IE5
|
---|
66 | xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
---|
67 | }
|
---|
68 | xmlhttp.onreadystatechange=function()
|
---|
69 | {
|
---|
70 | if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
---|
71 | {
|
---|
72 | var lines = xmlhttp.responseText.split('\n');
|
---|
73 | var arr = [];
|
---|
74 | var newline = [];
|
---|
75 | var arrTime = [];
|
---|
76 | var Time = [];
|
---|
77 | var colon = [];
|
---|
78 | for(var row=0;row<lines.length; row++)
|
---|
79 | {
|
---|
80 | var f = lines[row].split(',');
|
---|
81 | Time[row]=f[0];
|
---|
82 | //arr[row]="["+f[4]+"]";
|
---|
83 | for(var t=0; t<Time.length;t++)
|
---|
84 | {
|
---|
85 | var x=Time[t].split('T');
|
---|
86 | arr[t]=x[1];
|
---|
87 | for(var st=0;st<arr.length;st++)
|
---|
88 | {
|
---|
89 | var c=Time[st].split(':');
|
---|
90 |
|
---|
91 | if(f[4]==0)
|
---|
92 | {
|
---|
93 | newline[row]="["+0+"]";
|
---|
94 | }
|
---|
95 | else if(f[4]=="" && f[0]=="")
|
---|
96 | {
|
---|
97 | newline[row]="["+0+"]";
|
---|
98 | }
|
---|
99 | else
|
---|
100 | newline[row]="["+(parseFloat(f[4])||"0")+"]";
|
---|
101 |
|
---|
102 | }
|
---|
103 | //h[t]=x[1];
|
---|
104 |
|
---|
105 | }
|
---|
106 |
|
---|
107 | }
|
---|
108 | //source['Mrk 421']=arr;
|
---|
109 | document.getElementById('data').innerHTML=newline;
|
---|
110 |
|
---|
111 | var chart = new Highcharts.Chart({
|
---|
112 |
|
---|
113 |
|
---|
114 | chart: {
|
---|
115 | renderTo: 'container' /* display to div Graph*/
|
---|
116 | },
|
---|
117 |
|
---|
118 | xAxis: {
|
---|
119 | labels: {
|
---|
120 | rotation: -45,
|
---|
121 | align: 'right',
|
---|
122 | },
|
---|
123 | categories:["","","","","","","","19:00","20:00","21:00","22:00","23:00","24:00","1:00","2:00","3:00","4:00","5:00","6:00","7:00"]},
|
---|
124 | series:[{data:[newline]}], /* array of Data */
|
---|
125 |
|
---|
126 | remove:function()
|
---|
127 | {
|
---|
128 | return false;
|
---|
129 | },
|
---|
130 |
|
---|
131 | exporting: { /*--------------------*/
|
---|
132 | buttons: { /* */
|
---|
133 | exportButton: { /* Export */
|
---|
134 | menuItems: null, /* to */
|
---|
135 | onclick: function() { /* PNG.file */
|
---|
136 | this.exportChart(); /*--------------------*/
|
---|
137 | }
|
---|
138 | }
|
---|
139 | }
|
---|
140 | },
|
---|
141 |
|
---|
142 | plotOptions:
|
---|
143 | {
|
---|
144 | series: {
|
---|
145 | marker: {
|
---|
146 | enabled: false,
|
---|
147 |
|
---|
148 | }
|
---|
149 |
|
---|
150 | }
|
---|
151 | },
|
---|
152 |
|
---|
153 |
|
---|
154 |
|
---|
155 | });
|
---|
156 | /*$('#add').click(function(){
|
---|
157 |
|
---|
158 | });*/
|
---|
159 |
|
---|
160 | }
|
---|
161 | }
|
---|
162 | xmlhttp.open("GET","http://www.fact-project.org/smartfact/index.php?source="+'Mrk+421'+"&time="+year+"-"+month+"-"+day,true);
|
---|
163 | xmlhttp.send();
|
---|
164 | $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year);
|
---|
165 | });
|
---|
166 |
|
---|
167 | //]]></script>
|
---|
168 | </td>
|
---|
169 | </tr>
|
---|
170 |
|
---|
171 | </table>
|
---|
172 | </td>
|
---|
173 | </tr>
|
---|
174 | </table>
|
---|
175 |
|
---|
176 | </body>
|
---|
177 | </html>
|
---|