Changeset 16660
- Timestamp:
- 06/03/13 18:27:32 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/js/chart.js
r16659 r16660 85 85 var Time = new Array(source.length); 86 86 var Temp = new Array(); 87 var colonTime = new Array();88 var colonMin = new Array();89 87 var Hour = new Array(); 90 var newData = new Array();91 var HourMin = new Array();92 var GraphData = new Array();93 88 for (i=0; i<source.length; i++) 94 89 { 95 90 dataGraph[i] = new Array(); //dataGraph contains the individual points for each source i 96 91 Time[i] = new Array(); // Time contains the individual time for each sources. 92 chart.addSeries({name:source[i], data:[]}); // created a series of data and add name of displayed source 97 93 for(row=0;row<dataSource[i].length;row++) 98 94 { … … 100 96 Temp[row]=rows[0]; 101 97 dataGraph[i].push(parseFloat(rows[4])||parseFloat('0')); 102 for(T T=0;TT<Temp.length;TT++)98 for(T=0;T<Temp.length;T++) 103 99 { 104 rowsTime=Temp[TT].split(":"); 105 colonTime.push(rowsTime[0]); 106 colonMin.push(parseInt(rowsTime[1]/60*100)||parseFloat('0')); 100 rowHour=Temp[T].split('T'); 101 Time[i].push(parseFloat(rowHour[1])); 107 102 } 108 for(TH=0;TH<colonTime.length;TH++)109 {110 rowsHour=colonTime[TH].split('T');111 Hour.push(parseInt(rowsHour[1])||parseFloat('0'));112 }113 for(vTime=0;vTime<Hour.length;vTime++)114 {115 if(Hour[vTime]==0)116 {117 if(Hour[vTime]==8)118 {119 HourMin.push(Hour[vTime]+24+ '.08');120 }121 else122 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);123 }124 else if(Hour[vTime]==1)125 {126 if(Hour[vTime]==8)127 {128 HourMin.push(Hour[vTime]+24+ '.08');129 }130 else131 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);132 }133 else if(Hour[vTime]==2)134 {135 if(Hour[vTime]==8)136 {137 HourMin.push(Hour[vTime]+24+ '.08');138 }139 else140 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);141 }142 else if(Hour[vTime]==3)143 {144 if(Hour[vTime]==8)145 {146 HourMin.push(Hour[vTime]+24+ '.08');147 }148 else149 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);150 }151 else if(Hour[vTime]==4)152 {153 if(Hour[vTime]==8)154 {155 HourMin.push(Hour[vTime]+24+ '.08');156 }157 else158 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);159 }160 else if(Hour[vTime]==5)161 {162 if(Hour[vTime]==8)163 {164 HourMin.push(Hour[vTime]+24+ '.08');165 }166 else167 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);168 }169 else if(Hour[vTime]==6)170 {171 if(Hour[vTime]==8)172 {173 HourMin.push(Hour[vTime]+24+ '.08');174 }175 else176 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);177 }178 else if(Hour[vTime]==7)179 {180 if(Hour[vTime]==8)181 {182 HourMin.push(Hour[vTime]+24+ '.08');183 }184 else185 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);186 }187 else if(Hour[vTime]==8)188 {189 if(Hour[vTime]==8)190 {191 HourMin.push(Hour[vTime]+24+ '.08');192 }193 else194 HourMin.push(Hour[vTime]+24+'.'+colonMin[vTime]);195 }196 else if(colonMin[vTime]==8)197 {198 HourMin.push(Hour[vTime] + '.08');199 }200 else201 202 HourMin.push(Hour[vTime]+'.'+colonMin[vTime]);203 204 205 }206 Time[i].push(HourMin[row]);207 103 208 104 } 209 $('#data').append(i + ": " + source[i] + ' GRAPH DATA ' + dataGraph[i] + ' Time ' + Time[i]); 105 for(Graph=0;Graph<dataGraph[i].length;Graph++) 106 { 107 chart.series[i].addPoint({ // series[0] means index of zero in data; 108 x:Time[i][Graph], // Time 109 y:dataGraph[i][Graph] // Value 110 }) 111 } 112 //$('#data').append(i + ": " + source[i] + ' GRAPH DATA ' + dataGraph[i] + ' Time ' + Time[i]); 210 113 } 114 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year); 211 115 }
Note:
See TracChangeset
for help on using the changeset viewer.