Changeset 15701
- Timestamp:
- 05/20/13 06:42:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r15699 r15701 101 101 newdata=newline.join(","); 102 102 document.getElementById('data').innerHTML=newdata; 103 /*for(var c=0;c<newline.length;c++) 104 { 105 arr[c]; 106 }; 103 107 var chart = new Highcharts.Chart({ 104 108 … … 106 110 chart: { 107 111 renderTo: 'container' /* display to div Graph*/ 108 },112 /* }, 109 113 110 114 xAxis: { … … 114 118 }, 115 119 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"]}, 116 series:[ {data:[parseFloat(newdata)]}], /* array of Data */117 118 remove:function()120 series:[], /* array of Data */ 121 122 /*remove:function() 119 123 { 120 124 return false; … … 122 126 123 127 exporting: { /*--------------------*/ 124 buttons: { /* */125 exportButton: { /* Export */126 menuItems: null, /* to */127 onclick: function() { /* PNG.file */128 this.exportChart(); /*--------------------*/129 }128 /*buttons: { /* */ 129 /*exportButton: { /* Export */ 130 /* menuItems: null, /* to */ 131 /* onclick: function() { /* PNG.file */ 132 /* this.exportChart(); /*--------------------*/ 133 /*} 130 134 } 131 135 } … … 149 153 150 154 });*/ 151 155 $(function () { 156 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"}]'; 157 158 159 var options = { 160 chart: { 161 renderTo: 'container' 162 }, 163 xAxis: { 164 type:'datetime' 165 }, 166 series: [] 167 }; 168 169 data = JSON.parse(data); 170 var names = []; 171 $.each(data, function (i, ligne) { 172 var ind = names.indexOf(ligne.name), 173 splited = ligne.data.split(','), 174 x = parseFloat(splited[0]), 175 y = parseFloat(splited[1]); 176 if (ind == -1) { 177 ind = names.push(ligne.name) - 1; 178 options.series.push({ 179 data: [], 180 name: ligne.name 181 }); 182 } 183 if(!isNaN(x) && !isNaN(y)){ 184 options.series[ind].data.push([x,y]); 185 } 186 }); 187 188 console.log(options); 189 190 var chart = new Highcharts.Chart(options); 191 }); 152 192 153 193 }
Note:
See TracChangeset
for help on using the changeset viewer.