Changeset 16747 for schedule/js
- Timestamp:
- 06/06/13 15:10:28 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/js/chart.js
r16722 r16747 1 1 function GetData() 2 2 { 3 var source = new Array(); 3 4 //calls the xml request in a loop based on the current sources 4 var source = ['Mrk 421','Mrk 501']; 5 $('#box2View option').each(function(){ 6 source.push($(this).text()); 7 8 }); 9 console.log(source); 5 10 for (i = 0; i<source.length; i++) 6 11 { 7 // alert (source[i]);8 12 GetXMLData(i, source); 9 10 //$('#data').append('1st'+source);11 13 } 12 14 } 13 14 15 function GetXMLData(index, source) 15 16 { 16 // alert("test XML Data");17 17 var XML; 18 //$('#data').append(' xmlData pass'+source+" "+index);19 18 XML = new XMLHttpRequest(); 20 19 //NOTE: previous errors on the request was caused by appending "http://www.fact-project.org" … … 25 24 if (XML.status==200) 26 25 { 27 //alert("request ok");28 26 line=XML.responseText.split('\n'); 29 27 dataSource.push(line); 30 28 if (dataSource.length == source.length) 31 29 { 32 // alert("new datasource");33 30 displayXMLData(dataSource, source); //this will be called when the last data from the list is read 34 //$('#data').append('successfully load'+source +""+dataSource);35 36 31 } 37 32 } … … 86 81 var dataGraph = new Array(source.length); 87 82 var Time = new Array(source.length); 88 var Temp = new Array();89 //var Hour = new Array();90 //var Min = new Array();91 83 var HourMin = new Array(); 92 //var TempHour = new Array();93 84 var chart = new Highcharts.Chart(options); 94 85 for (i=0; i<source.length; i++) … … 101 92 { 102 93 rows=dataSource[i][row].split(','); 103 Temp[row]=rows[0];104 94 dataGraph[i].push(parseFloat(rows[4])||parseFloat('0')); 105 95 dateTime = new Date(rows[0]); … … 114 104 }) 115 105 } 116 //$('#data').append(i + ": " + source[i] + ' Time ' + Time[i]);117 $('#data').append(i + ": " + source[i] + ' Data ' + dataGraph[i]);118 106 } 119 107
Note:
See TracChangeset
for help on using the changeset viewer.