Changeset 16216
- Timestamp:
- 05/25/13 00:22:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16215 r16216 106 106 if(xml.readyState==4 && xml.status ==200) 107 107 { 108 var lines=xml.responseText.split("\n"); 109 for(var row=0;row<lines.length;row++) 108 function LoadData() 110 109 { 111 var splitted=lines[row].split(','); 112 Time1[row]=splitted[0]; 113 for(var SplittedTime=0;SplittedTime<Time1.length;SplittedTime++) 110 var lines=xml.responseText.split("\n"); 111 for(var row=0;row<lines.length;row++) 114 112 { 115 var SplitTime=Time1[SplittedTime].split(':'); 116 TimeColon[SplittedTime]=SplitTime[0]; 117 MinTime[SplittedTime]=(parseInt(SplitTime[1]/60*100)||parseInt("0")); 118 for(var TimeT=0;TimeT<TimeColon.length;TimeT++) 113 var splitted=lines[row].split(','); 114 Time1[row]=splitted[0]; 115 for(var SplittedTime=0;SplittedTime<Time1.length;SplittedTime++) 119 116 { 120 var SplittedT=TimeColon[TimeT].split('T'); 121 HourTime[TimeT]=(parseFloat(SplittedT[1])||parseInt('0')); 117 var SplitTime=Time1[SplittedTime].split(':'); 118 TimeColon[SplittedTime]=SplitTime[0]; 119 MinTime[SplittedTime]=(parseInt(SplitTime[1]/60*100)||parseInt("0")); 120 for(var TimeT=0;TimeT<TimeColon.length;TimeT++) 121 { 122 var SplittedT=TimeColon[TimeT].split('T'); 123 HourTime[TimeT]=(parseFloat(SplittedT[1])||parseInt('0')); 124 } 122 125 } 126 DataVal[row]=(parseFloat(splitted[4])||parseInt('0')); 127 //document.getElementById('data').innerHTML=DataValue; 128 129 for(var Data=0; Data<DataVal.length;Data++) 130 { 131 if(DataVal[Data]==0) 132 { 133 134 } 135 else 136 DataValue.push(parseFloat(DataVal[Data])); 137 } 138 139 140 for(var ConTime=1;ConTime<HourTime.length-1;ConTime++) 141 { 142 if(HourTime[ConTime]==0) 143 { 144 if(MinTime[ConTime]==8) 145 { 146 Time.push(HourTime[ConTime]+24+'.'+'.08'); 147 } 148 else 149 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 150 } 151 else if(HourTime[ConTime]==1) 152 { 153 if(MinTime[ConTime]==8) 154 { 155 Time.push(HourTime[ConTime]+24+'.'+'.08'); 156 } 157 else 158 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 159 } 160 else if(HourTime[ConTime]==2) 161 { 162 if(MinTime[ConTime]==8) 163 { 164 Time.push(HourTime[ConTime]+24+'.'+'.08'); 165 } 166 else 167 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 168 } 169 else if(HourTime[ConTime]==3) 170 { 171 if(MinTime[ConTime]==8) 172 { 173 Time.push(HourTime[ConTime]+24+'.'+'.08'); 174 } 175 else 176 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 177 } 178 else if(HourTime[ConTime]==4) 179 { 180 if(MinTime[ConTime]==8) 181 { 182 Time.push(HourTime[ConTime]+24+'.'+'.08'); 183 } 184 else 185 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 186 } 187 else if(HourTime[ConTime]==5) 188 { 189 if(MinTime[ConTime]==8) 190 { 191 Time.push(HourTime[ConTime]+24+'.'+'.08'); 192 } 193 else 194 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 195 } 196 else if(HourTime[ConTime]==6) 197 { 198 if(MinTime[ConTime]==8) 199 { 200 Time.push(HourTime[ConTime]+24+'.'+'.08'); 201 } 202 else 203 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 204 } 205 else 206 Time.push(HourTime[ConTime]+'.'+MinTime[ConTime]); 207 208 } 209 210 //GrapData(Data,Time); 211 123 212 } 124 DataVal[row]=(parseFloat(splitted[4])||parseInt('0')); 125 //document.getElementById('data').innerHTML=DataValue; 126 127 for(var Data=0; Data<DataVal.length;Data++) 128 { 129 if(DataVal[Data]==0) 130 { 131 132 } 133 else 134 DataValue.push(parseFloat(DataVal[Data])); 135 } 136 137 138 for(var ConTime=1;ConTime<HourTime.length-1;ConTime++) 139 { 140 if(HourTime[ConTime]==0) 141 { 142 if(MinTime[ConTime]==8) 143 { 144 Time.push(HourTime[ConTime]+24+'.'+'.08'); 145 } 146 else 147 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 148 } 149 else if(HourTime[ConTime]==1) 150 { 151 if(MinTime[ConTime]==8) 152 { 153 Time.push(HourTime[ConTime]+24+'.'+'.08'); 154 } 155 else 156 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 157 } 158 else if(HourTime[ConTime]==2) 159 { 160 if(MinTime[ConTime]==8) 161 { 162 Time.push(HourTime[ConTime]+24+'.'+'.08'); 163 } 164 else 165 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 166 } 167 else if(HourTime[ConTime]==3) 168 { 169 if(MinTime[ConTime]==8) 170 { 171 Time.push(HourTime[ConTime]+24+'.'+'.08'); 172 } 173 else 174 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 175 } 176 else if(HourTime[ConTime]==4) 177 { 178 if(MinTime[ConTime]==8) 179 { 180 Time.push(HourTime[ConTime]+24+'.'+'.08'); 181 } 182 else 183 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 184 } 185 else if(HourTime[ConTime]==5) 186 { 187 if(MinTime[ConTime]==8) 188 { 189 Time.push(HourTime[ConTime]+24+'.'+'.08'); 190 } 191 else 192 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 193 } 194 else if(HourTime[ConTime]==6) 195 { 196 if(MinTime[ConTime]==8) 197 { 198 Time.push(HourTime[ConTime]+24+'.'+'.08'); 199 } 200 else 201 Time.push(HourTime[ConTime]+24+'.'+MinTime[ConTime]); 202 } 203 else 204 Time.push(HourTime[ConTime]+'.'+MinTime[ConTime]); 205 206 } 207 208 //GrapData(Data,Time); 209 213 Charts(DataValue,Time); 210 214 } 211 215 212 213 function Charts( )216 LoadData(); 217 function Charts(y,x) 214 218 { 215 219 var options = { … … 254 258 { 255 259 chart.addSeries({name:source[src], data:[]}); // created a series of data and add name of displayed source 256 for(var DataCnt=0;DataCnt< DataValue[src].length;DataCnt++)260 for(var DataCnt=0;DataCnt<y[src].length;DataCnt++) 257 261 { 258 262 259 263 chart.series[src].addPoint({ // series[0] means index of zero in data; 260 x: Time[src][DataCnt], // Time261 y: DataValue[src][DataCnt] // Value264 x:x[src][DataCnt], // Time 265 y:y[src][DataCnt] // Value 262 266 }) 263 267 //document.getElementById('data').innerHTML=Time[src][DataCnt];
Note:
See TracChangeset
for help on using the changeset viewer.