| @@ -108,13 +108,13 @@ function LoadServer() { | |||
| } | |||
| Date.prototype.Format = function (fmt) { | |||
| var o = { | |||
| "M+": this.getMonth() + 1, //月份 | |||
| "d+": this.getDate(), //日 | |||
| "h+": this.getHours(), //小时 | |||
| "m+": this.getMinutes(), //分 | |||
| "s+": this.getSeconds(), //秒 | |||
| "q+": Math.floor((this.getMonth() + 3) / 3), //季度 | |||
| "S": this.getMilliseconds() //毫秒 | |||
| "M+" : this.getMonth() + 1, //月份 | |||
| "d+" : this.getDate(), //日 | |||
| "h+" : this.getHours(), //小时 | |||
| "m+" : this.getMinutes(), //分 | |||
| "s+" : this.getSeconds(), //秒 | |||
| "q+" : Math.floor((this.getMonth() + 3) / 3), //季度 | |||
| "S" : this.getMilliseconds() //毫秒 | |||
| }; | |||
| if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); | |||
| for (var k in o) | |||
| @@ -167,6 +167,8 @@ function LoadStat() { | |||
| }); | |||
| } | |||
| async function LoadStatChart() { | |||
| Chart.defaults.font.size = 14; | |||
| Chart.defaults.color = '#545b62'; | |||
| const ctx = document.getElementById('statChart').getContext('2d'); | |||
| let labels = []; | |||
| let dates = []; | |||
| @@ -193,46 +195,46 @@ async function LoadStatChart() { | |||
| }); | |||
| } | |||
| const myChart = new Chart(ctx, { | |||
| type:'line', | |||
| options:{ | |||
| responsive:true, | |||
| plugins:{ | |||
| legend:{ | |||
| position:'right', | |||
| type: 'line', | |||
| options: { | |||
| responsive: true, | |||
| plugins: { | |||
| legend: { | |||
| position: 'right', | |||
| } | |||
| } | |||
| }, | |||
| data:{ | |||
| labels:labels, | |||
| datasets:[ | |||
| data: { | |||
| labels: labels, | |||
| datasets: [ | |||
| { | |||
| label:'PV', | |||
| data:pvs, | |||
| lineTension:.5, | |||
| borderColor:'rgba(54, 162, 235, 1)', | |||
| backgroundColor:'rgba(54, 162, 235, 0.2)', | |||
| borderWidth:2 | |||
| label: 'PV', | |||
| data: pvs, | |||
| lineTension: .5, | |||
| borderColor: 'rgba(54, 162, 235, 1)', | |||
| backgroundColor: 'rgba(54, 162, 235, 0.2)', | |||
| borderWidth: 2 | |||
| }, { | |||
| label:'UV', | |||
| data:uvs, | |||
| lineTension:.5, | |||
| borderColor:'rgba(255, 206, 86, 1)', | |||
| backgroundColor:'rgba(255, 206, 86, 0.2)', | |||
| borderWidth:2 | |||
| label: 'UV', | |||
| data: uvs, | |||
| lineTension: .5, | |||
| borderColor: 'rgba(255, 206, 86, 1)', | |||
| backgroundColor: 'rgba(255, 206, 86, 0.2)', | |||
| borderWidth: 2 | |||
| }, { | |||
| label:'IP', | |||
| data:ips, | |||
| lineTension:.5, | |||
| borderColor:'rgba(255, 99, 132, 1)', | |||
| backgroundColor:'rgba(255, 99, 132, 0.2)', | |||
| borderWidth:2 | |||
| label: 'IP', | |||
| data: ips, | |||
| lineTension: .5, | |||
| borderColor: 'rgba(255, 99, 132, 1)', | |||
| backgroundColor: 'rgba(255, 99, 132, 0.2)', | |||
| borderWidth: 2 | |||
| }, { | |||
| label:'VV', | |||
| data:vvs, | |||
| lineTension:.5, | |||
| borderColor:'rgba(75, 192, 192, 1)', | |||
| backgroundColor:'rgba(75, 192, 192, 0.2)', | |||
| borderWidth:2 | |||
| label: 'VV', | |||
| data: vvs, | |||
| lineTension: .5, | |||
| borderColor: 'rgba(75, 192, 192, 1)', | |||
| backgroundColor: 'rgba(75, 192, 192, 0.2)', | |||
| borderWidth: 2 | |||
| } | |||
| ] | |||
| }, | |||