Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'localhost';
- $user = 'root';
- $pass = '';
- $db = 'apotek';
- $conn = mysql_connect($host, $user, $pass);
- mysql_select_db($db, $conn);
- ?>
- <!-- end of forever fp services -->
- <div id="tooplate_main">
- <script type="text/javascript" src="js/jquery1.min.js"></script>
- <script type="text/javascript">
- $(function () {
- $(document).ready(function () {
- // Build the chart
- $('#container').highcharts({
- chart: {
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- title: {
- text: 'Jumlah Obat Terlaris'
- },
- tooltip: {
- pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
- cursor: 'pointer',
- dataLabels: {
- enabled: false
- },
- showInLegend: true
- }
- },
- series: [{
- type: 'pie',
- name: 'Data Check List',
- data: [
- ['nama_obat', <?php
- $result = mysql_query("SELECT nama_obat, kode_obat, SUM(qty) qty FROM tb_penjualan GROUP BY nama_obat ORDER BY qty DESC LIMIT 5");
- $num_rows = mysql_num_rows($result);
- echo $num_rows; ?>.0],
- ]
- }]
- });
- });
- });
- </script>
- </head>
- <body>
- <script src="js/highcharts.js"></script>
- <div id="container" style="min-width: 310px; height: 400px; max-width: 900px; margin: 0 auto"></div>
- <!-- end of main -->
- <div id="tooplate_footer">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement