Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Grafik Penduduk Indonesia</title>
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- <script src="http://code.highcharts.com/highcharts.js"></script>
- <script src="http://code.highcharts.com/modules/exporting.js"></script>
- <script type="text/javascript">
- var chart1; // globally available
- $(document).ready(function() {
- chart1 = new Highcharts.Chart({
- chart: {
- renderTo: 'container',
- type: 'column'
- },
- title: {
- text: 'Data Pasien Menurut Jenis Kelamin'
- },
- xAxis: {
- categories: ['Jenis Kelamin']
- },
- yAxis: {
- title: {
- text: 'Jumlah Pasien'
- }
- },
- series:
- [
- <?php
- $server = "localhost";
- $username = "root";
- $password = "";
- $database = "rs.paru";
- mysql_connect($server,$username,$password) or die("Koneksi gagal");
- mysql_select_db($database) or die("Database tidak bisa dibuka");
- $sql = "SELECT distinct jeniskelaminPasien from pasien group by jeniskelaminPasien";
- $query = mysql_query( $sql ) or die(mysql_error());
- while($ambil = mysql_fetch_array($query)){
- $jeniskelaminPasien=$ambil['jeniskelaminPasien'];
- $sql_jumlah = "SELECT count(*) from pasien where jeniskelaminPasien='$jeniskelaminPasien'";
- $query_jumlah = mysql_query( $sql_jumlah ) or die(mysql_error());
- while( $data = mysql_fetch_array( $query_jumlah ) ){
- $jumlahx = $data['jeniskelaminPasien'];
- }
- ?>
- {
- name: '<?php echo $jeniskelaminPasien; ?>',
- data: [<?php echo $jumlahx; ?>]
- },
- <?php } ?>
- ]
- });
- });
- </script>
Add Comment
Please, Sign In to add comment