- Timestamp:
- 05/24/13 19:20:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16194 r16195 78 78 var xml; 79 79 var Time = [[]]; 80 var Data = [[]]; 80 var DataValue = [[]]; 81 var Time1 = []; 81 82 var TimeColon = []; 82 83 var MinTime = []; 83 84 var HourTime = []; 84 85 var DataVal = []; 85 var source=['Crab','Mrk 501','Mrk 4 02'];86 var source=['Crab','Mrk 501','Mrk 421']; 86 87 var options = { 87 88 chart: { … … 140 141 { 141 142 var splitted=lines[row].split(','); 142 Time [row]=splitted[0];143 for(var SplittedTime=0;SplittedTime<Time .length;SplittedTime++)143 Time1[row]=splitted[0]; 144 for(var SplittedTime=0;SplittedTime<Time1.length;SplittedTime++) 144 145 { 145 var SplitTime=Time [SplittedTime].split(':');146 var SplitTime=Time1[SplittedTime].split(':'); 146 147 TimeColon[SplittedTime]=SplitTime[0]; 147 MinTime[SplittedTime]=(parseInt(SplitTime[1]/60*100)||parse Float("0"));148 MinTime[SplittedTime]=(parseInt(SplitTime[1]/60*100)||parseInt("0")); 148 149 for(var TimeT=0;TimeT<TimeColon.length;TimeT++) 149 150 { 150 151 var SplittedT=TimeColon[TimeT].split('T'); 151 HourTime[TimeT]=(parseFloat(SplittedT[1])||parse Float('0'));152 HourTime[TimeT]=(parseFloat(SplittedT[1])||parseInt('0')); 152 153 } 153 154 } 154 DataVal[row]=(parseFloat(splitted[4])||parse Float('0'));155 for(var Data=0; Data<DataVal.length;Data++)156 {157 if(DataVal[Data]==0)155 DataVal[row]=(parseFloat(splitted[4])||parseInt('0')); 156 //document.getElementById('data').innerHTML=DataValue; 157 158 for(var Data=0; Data<DataVal.length;Data++) 158 159 { 159 160 } 161 else 162 Data[i][Data]=parseFlaot(DataVal[Data]); 163 } 164 for(var ConTime=1;ConTime<HourTime.length-1;ConTime++) 165 { 166 if(HourTime[ConTime]=='0') 160 if(DataVal[Data]==0) 161 { 162 163 } 164 else 165 DataValue.push(parseFloat(DataVal[Data])); 166 } 167 168 169 for(var ConTime=1;ConTime<HourTime.length-1;ConTime++) 167 170 { 168 if(MinTime[ConTime]==8) 169 { 170 Time[i][ConTime]=HourTime[ConTime]+24+'.'+'.08'; 171 if(HourTime[ConTime]==0) 172 { 173 if(MinTime[ConTime]==8) 174 { 175 Time.push(HourTime[ConTime]+24+'.'+'.08'); 176 } 177 else 178 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 179 } 180 else if(HourTime[ConTime]==1) 181 { 182 if(MinTime[ConTime]==8) 183 { 184 Time.push(HourTime[ConTime]+24+'.'+'.08'); 185 } 186 else 187 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 188 } 189 else if(HourTime[ConTime]==2) 190 { 191 if(MinTime[ConTime]==8) 192 { 193 Time.push(HourTime[ConTime]+24+'.'+'.08'); 194 } 195 else 196 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 197 } 198 else if(HourTime[ConTime]==3) 199 { 200 if(MinTime[ConTime]==8) 201 { 202 Time.push(HourTime[ConTime]+24+'.'+'.08'); 203 } 204 else 205 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 206 } 207 else if(HourTime[ConTime]==4) 208 { 209 if(MinTime[ConTime]==8) 210 { 211 Time.push(HourTime[ConTime]+24+'.'+'.08'); 212 } 213 else 214 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 215 } 216 else if(HourTime[ConTime]==5) 217 { 218 if(MinTime[ConTime]==8) 219 { 220 Time.push(HourTime[ConTime]+24+'.'+'.08'); 221 } 222 else 223 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 224 } 225 else if(HourTime[ConTime]==6) 226 { 227 if(MinTime[ConTime]==8) 228 { 229 Time.push(HourTime[ConTime]+24+'.'+'.08'); 230 } 231 else 232 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 171 233 } 172 234 else 173 Time[i][ConTime]=HourTime[ConTime]+24+'.'+MinTime[ConTime]; 174 } 175 else if(HourTime[ConTime]=='1') 176 { 177 if(MinTime[ConTime]==8) 178 { 179 Time[i][ConTime]=HourTime[ConTime]+24+'.'+'.08'; 180 } 181 else 182 Time[i][ConTime]=HourTime[ConTime]+24+'.'+MinTime[ConTime]; 183 } 184 else if(HourTime[ConTime]==2) 185 { 186 if(MinTime[ConTime]==8) 187 { 188 Time[i][ConTime]=HourTime[ConTime]+24+'.'+'.08'; 189 } 190 else 191 Time[i][ConTime]=HourTime[ConTime]+24+'.'+MinTime[ConTime]; 192 } 193 else if(HourTime[ConTime]==3) 194 { 195 if(MinTime[ConTime]==8) 196 { 197 Time[i][ConTime]=HourTime[ConTime]+24+'.'+'.08'; 198 } 199 else 200 Time[i][ConTime]=HourTime[ConTime]+24+'.'+MinTime[ConTime]; 201 } 202 else if(HourTime[ConTime]==4) 203 { 204 if(MinTime[ConTime]==8) 205 { 206 Time[i][ConTime]=HourTime[ConTime]+24+'.'+'.08'; 207 } 208 else 209 Time[i][ConTime]=HourTime[ConTime]+24+'.'+MinTime[ConTime]; 210 } 211 else if(HourTime[ConTime]==5) 212 { 213 if(MinTime[ConTime]==8) 214 { 215 Time[i][ConTime]=HourTime[ConTime]+24+'.'+'.08'; 216 } 217 else 218 Time[i][ConTime]=HourTime[ConTime]+24+'.'+MinTime[ConTime]; 219 } 220 else if(HourTime[ConTime]==6) 221 { 222 if(MinTime[ConTime]==8) 223 { 224 Time[i][ConTime]=HourTime[ConTime]+24+'.'+'.08'; 225 } 226 else 227 Time[i][ConTime]=HourTime[ConTime]+24+'.'+MinTime[ConTime]; 228 } 229 else 230 Time[i][ConTime]=HourTime[ConTime]+'.'+MinTime[ConTime]; 231 } 235 Time.push(HourTime[ConTime]+'.'+MinTime[ConTime]); 236 237 } 238 232 239 //GrapData(Data,Time); 233 }234 235 var chart = new Highcharts.Chart(options);236 for(var src=0;src<i;src++)237 {238 chart.addSeries({name:source[src], data:[]}); // created a series of data and add name of displayed source239 for(var DataCnt=0;DataCnt<Data.length;DataCnt++)240 {241 242 chart.series[i].addPoint({ // series[0] means index of zero in data;243 x:Time[src][DataCnt], // Time244 y:Data[src][DataCnt] // Value245 })246 240 247 241 } 248 242 249 } 243 var chart = new Highcharts.Chart(options); 244 for(var src=0;src<i;src++) 245 { 246 chart.addSeries({name:source[src], data:[]}); // created a series of data and add name of displayed source 247 for(var DataCnt=0;DataCnt<DataValue[src].length;DataCnt++) 248 { 249 250 chart.series[src].addPoint({ // series[0] means index of zero in data; 251 x:Time[src][DataCnt], // Time 252 y:DataValue[src][DataCnt] // Value 253 }) 254 //document.getElementById('data').innerHTML=Time[src][DataCnt]; 255 256 } 257 258 } 250 259 251 260 … … 254 263 xml.open("GET","http://www.fact-project.org/smartfact/index.php?source="+escape(source[i])+"&time="+year+"-"+month+"-"+day,true); 255 264 xml.send(); 256 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year);265 257 266 258 267 } 259 268 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year); 260 269 261 270 });
Note:
See TracChangeset
for help on using the changeset viewer.