Guest User

grafik

a guest
Aug 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="author" content="ilmu-detil.blogspot.com">
  8. <title>Bootstrap Graph Using Highcharts </title>
  9. <!-- Bagian css -->
  10. <script src="assets/js/jquery-1.10.1.min.js"></script>
  11. <script src="assets/js/highcharts.js"></script>
  12. <script>
  13. var chart1;
  14. $(document).ready(function() {
  15. chart1 = new Highcharts.Chart({
  16. chart: {
  17. renderTo: 'mygraph',
  18. type: 'column'
  19. },
  20. title: {
  21. text: 'Grafik Pengunjung '
  22. },
  23. xAxis: {
  24. categories: ['Grafik']
  25. },
  26. yAxis: {
  27. title: {
  28. text: 'Jumlah Pengunjung'
  29. }
  30. },
  31. series:
  32. [
  33. <?php
  34. include "../koneksi.php";
  35. $sql = "SELECT kelas FROM tbl_pengunjung";
  36. $query = mysqli_query( $mysqli, $sql ) or die(mysqli_error());
  37. while( $temp = mysqli_fetch_array( $query ) )
  38. {
  39. $trendbrowser=$temp['kelas'];
  40. $sql_total = "SELECT tgl_kunjung FROM tbl_pengunjung WHERE kelas='$trendbrowser'";
  41. $query_total = mysqli_query($mysqli,$sql_total ) or die(mysql_error());
  42. while( $data = mysqli_fetch_array( $query_total ) )
  43. {
  44. $tgl_kunjung = $data['tgl_kunjung'];
  45. }
  46. ?>
  47. {
  48. name: '<?php echo $trendbrowser; ?>',
  49. data: [<?php echo $tgl_kunjung; ?>]
  50. },
  51. <?php
  52. } ?>
  53. ]
  54. });
  55. });
  56. </script>
  57. </head>
  58. <body>
  59.  
  60. <!--- Bagian Judul-->
  61. <div class="container" style="margin-top:20px">
  62. <div class="col-md-10">
  63. <div class="panel panel-primary">
  64. <div class="panel-heading">The Graph of Browser Trends</div>
  65. <div class="panel-body">
  66. <div id ="mygraph"></div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment