hellen513

Untitled

Jan 7th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. <div id="main-content" class="main-content container">
  2. <!-- // page head -->
  3. <br>
  4. <div class="span12">
  5. <div class="widget widget-simple widget-collapsible">
  6. <div class="widget-header">
  7. <h4> <small>Grafik Pengunjung CG Digital</small></h4>
  8.  
  9. <div class="widget-tool"><a class="btn btn-glyph btn-link widget-toggle fontello-icon-publish" data-toggle="collapse" data-target="#grafik" href="javascript:void(0);"></a></div>
  10. </div><br>
  11. <form canvas id="bar" name="bar" method="post" >
  12. <div id="grafik" align="center">
  13. Bulan
  14. <select name="bulan">
  15. <option value="01">Januari</option>
  16. <option value="02">Februari</option>
  17. <option value="03">Maret</option>
  18. <option value="04">April</option>
  19. <option value="05">Mei</option>
  20. <option value="06">Juni</option>
  21. <option value="07">Juli</option>
  22. <option value="08">Agustus</option>
  23. <option value="09">September</option>
  24. <option value="10">Oktober</option>
  25. <option value="11">November</option>
  26. <option value="12">Desember</option>
  27. </select>
  28. Tahun
  29. <select name="tahun">
  30. <?php
  31. $mulai= date('Y') - 50;
  32. for($i = $mulai;$i<$mulai + 100;$i++){
  33. $sel = $i == date('Y') ? ' selected="selected"' : '';
  34. echo '<option value="'.$i.'"'.$sel.'>'.$i.'</option>';
  35. }
  36. ?>
  37.  
  38. </div>
  39.  
  40. </select>
  41. <button class="btn" >Submit</button>
  42. </form>
  43. <div id="grafik" class="widget-content collapse in">
  44. <canvas id="charts"></canvas>
  45. <div class="widget-footer"></div>
  46. </div>
  47. </div>
  48. <!-- // Widget -->
  49.  
  50. </div>
  51. <!-- // Column -->
  52.  
  53. </div>
  54. <script>
  55. var ctx = $("#charts");
  56. var myChart = new Chart(ctx, {
  57. type: 'bar',
  58. data: {
  59. labels: [<?php while ($b = mysqli_fetch_array($tanggal)) { echo '"' . $b['tanggal'] . '",';}?>],
  60. datasets: [{
  61. label: '# of Votes',
  62. data: [<?php while ($p = mysqli_fetch_array($jumlah)) { echo '"' . $p['peng_setting'] . '",';}?>],
  63. backgroundColor: [
  64. 'rgba(255, 99, 132, 0.2)',
  65. 'rgba(54, 162, 235, 0.2)',
  66. 'rgba(255, 206, 86, 0.2)',
  67. 'rgba(75, 192, 192, 0.2)',
  68. 'rgba(153, 102, 255, 0.2)',
  69. 'rgba(255, 159, 64, 0.2)'
  70. ],
  71. borderColor: [
  72. 'rgba(255,99,132,1)',
  73. 'rgba(54, 162, 235, 1)',
  74. 'rgba(255, 206, 86, 1)',
  75. 'rgba(75, 192, 192, 1)',
  76. 'rgba(153, 102, 255, 1)',
  77. 'rgba(255, 159, 64, 1)'
  78. ],
  79. borderWidth: 1
  80. }]
  81. },
  82. options: {
  83. scales: {
  84. yAxes: [{
  85. ticks: {
  86. beginAtZero: true
  87. }
  88. }]
  89. }
  90. }
  91. });
  92. </script>
Advertisement
Add Comment
Please, Sign In to add comment