Changeset 15703
- Timestamp:
- 05/20/13 07:16:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r15702 r15703 81 81 Time[row]=f[0]; 82 82 //var DateT= new Date(Time); 83 //arr[row]="["+f[4]+"]"; 84 for(var t=0; t<Time.length;t++) 85 { 86 var x=Time[t].split('T'); 87 arr[t]=x[1]; 88 for(var st=0;st<arr.length;st++) 89 { 90 var c=Time[st].split(':'); 91 92 newline[row]=(parseFloat(f[4])||parseInt("0")); 93 94 95 } 96 //h[t]=x[1]; 97 98 } 99 83 //arr[row]="["+f[4]+"]"; 84 newline[row]=(parseFloat(f[4])||parseInt("0")); 85 86 } 100 87 } 101 88 newdata=newline.join(","); 102 89 document.getElementById('data').innerHTML=newdata; 103 $(function () { 104 //var data = '[{"name":"Station 1","data":"1360191600,398.625"},{"name":"Station 1","data":"1360192500,398.625"},{"name":"Station 1","data":"1360193400,398.25"},{"name":"Station 1","data":"1360194300,397.375"},{"name":"Station 1","data":"1360195200,397.5"},{"name":"Station 1","data":"1360196100,397.5"},{"name":"Station 1","data":"1360199700,396.75"},{"name":"Station 1","data":"1360200600,397"}]'; 105 106 107 var options = { 108 chart: { 109 renderTo: 'container' 110 }, 111 xAxis: { 112 type:'datetime' 113 }, 114 series: [] 115 }; 116 117 newline = JSON.parse(newline); 118 var names = []; 119 $.each(newline, function (i, ligne) { 120 var ind = names.indexOf(ligne.name), 121 splited = ligne.newline.split(','), 122 x = parseFloat(splited[0]), 123 y = parseFloat(splited[1]); 124 if (ind == -1) { 125 ind = names.push(ligne.name) - 1; 126 options.series.push({ 127 data: [], 128 name: ligne.name 129 }); 130 } 131 if(!isNaN(x) && !isNaN(y)){ 132 options.series[ind].newline.push([x,y]); 90 /*if(source==<?php echo $rows['SourceID']; ?>) 91 { 92 if(chart.series) 93 { 94 <?php $s=$rows['SourceID']; ?>*/ 95 chart.addSeries({name:$(this).text(), 96 data:[newdata] 97 }); 98 /*} 99 } 100 /*for (var i = 0; i < newSeries.data.length; i++) { 101 var datum = newSeries.data[i]; 102 datum.marker = { 103 enabled: false, 104 states: { 105 hover: { 106 enabled: false, 107 lineColor: '#ff0000' 108 } 109 } 110 }; 111 for(var c=0;c<newline.length;c++) 112 { 113 arr[c]; 114 };*/ 115 var chart = new Highcharts.Chart({ 116 117 118 chart: { 119 renderTo: 'container' /* display to div Graph*/ 120 }, 121 122 xAxis: { 123 labels: { 124 rotation: -45, 125 align: 'right', 126 }, 127 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"]}, 128 series:[], /* array of Data */ 129 130 remove:function() 131 { 132 return false; 133 }, 134 135 exporting: { /*--------------------*/ 136 buttons: { /* */ 137 exportButton: { /* Export */ 138 menuItems: null, /* to */ 139 onclick: function() { /* PNG.file */ 140 this.exportChart(); /*--------------------*/ 141 } 142 } 133 143 } 134 } );144 }, 135 145 136 console.log(options); 137 138 var chart = new Highcharts.Chart(options); 146 plotOptions: 147 { 148 series: { 149 marker: { 150 enabled: true, 151 152 } 153 154 } 155 }, 156 157 158 139 159 }); 160 /*$('#add').click(function(){ 161 162 });*/ 163 140 164 141 165 }
Note:
See TracChangeset
for help on using the changeset viewer.