Advertisement
anggadita_

Untitled

Aug 5th, 2017
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1.  
  2. <?php
  3. $host = 'localhost';
  4. $user = 'root';
  5. $pass = '';
  6. $db = 'apotek';
  7.  
  8. $conn = mysql_connect($host, $user, $pass);
  9. mysql_select_db($db, $conn);
  10. ?>
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. <!-- end of forever fp services -->
  19.  
  20. <div id="tooplate_main">
  21. <script type="text/javascript" src="js/jquery1.min.js"></script>
  22. <script type="text/javascript">
  23. $(function () {
  24.  
  25. $(document).ready(function () {
  26.  
  27. // Build the chart
  28. $('#container').highcharts({
  29. chart: {
  30. plotBackgroundColor: null,
  31. plotBorderWidth: null,
  32. plotShadow: false
  33. },
  34. title: {
  35. text: 'Jumlah Obat Terlaris'
  36. },
  37. tooltip: {
  38. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  39. },
  40. plotOptions: {
  41. pie: {
  42. allowPointSelect: true,
  43. cursor: 'pointer',
  44. dataLabels: {
  45. enabled: false
  46. },
  47. showInLegend: true
  48. }
  49. },
  50. series: [{
  51. type: 'pie',
  52. name: 'Data Check List',
  53. data: [
  54. ['nama_obat', <?php
  55. $result = mysql_query("SELECT nama_obat, kode_obat, SUM(qty) qty FROM tb_penjualan GROUP BY nama_obat ORDER BY qty DESC LIMIT 5");
  56. $num_rows = mysql_num_rows($result);
  57. echo $num_rows; ?>.0],
  58. ]
  59. }]
  60. });
  61. });
  62.  
  63. });
  64. </script>
  65. </head>
  66. <body>
  67. <script src="js/highcharts.js"></script>
  68.  
  69.  
  70. <div id="container" style="min-width: 310px; height: 400px; max-width: 900px; margin: 0 auto"></div>
  71.  
  72. <!-- end of main -->
  73.  
  74. <div id="tooplate_footer">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement