<div class="row">
    <div class="col-md-12">
        <a name="bulan"></a>
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">Kunjungan Rawat Inap</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    <a href="<?php echo base_url('admin/home'); ?>" class="btn btn-box-tool"><i class="fa fa-times"></i></a>
                </div>
            </div>
            
            <div class="box-body">
                  <a href="<?php echo base_url('admin/view/kunjunganirna'); ?>" class="btn btn-info">Hari Ini</a>
                  <a href="<?php echo base_url('admin/view/kunjunganirnabln'); ?>" class="btn btn-info">Bulan Ini</a>
                  <a href="<?php echo base_url('admin/view/kunjunganirnathn'); ?>" class="btn btn-info">Tahun Ini</a>
                  <div id="kinap" class="chart"></div>
                  <hr>
                  <center>
                    <h2>Berdasarkan Kelas Rawat</h2>
                    <div id="kinapkelas" class="chart"></div>
                  </center>
                </div>
            </div>
            <div class="box-footer"><i class="fa fa-clock-o"></i> Data realtime</div>
        </div>
    </div>
</div>

<script type="text/javascript">
// ===== KUNJUNGAN IRJA HARI INI =====
var kinap = AmCharts.makeChart( "kinap", {
    "theme": "light",
    "type": "serial",
    "startDuration": 2,
    "dataProvider": [
      <?php foreach ($chart_kunjungan_irna as $content): ?>
        {
            "country": "JKN-PBI",
            "visits": <?php echo $content->pbi; ?>,
            "color": "#FDD400"
        }, {
            "country": "JKN-NON-PBI",
            "visits": <?php echo $content->nonpbi; ?>,
            "color": "#84B761"
        }, {
            "country": "JAMKESDA",
            "visits": <?php echo $content->jamkesda; ?>,
            "color": "#CC4748"
        }, {
            "country": "UMUM",
            "visits": <?php echo $content->umum; ?>,
            "color": "#67B7DC"
        }
        <?php endforeach; ?>
        ],
    "valueAxes": [{
        "position": "left",
        "axisAlpha":0,
        "gridAlpha":0
    }],
    "graphs": [{
        "balloonText": "[[category]]: <b>[[value]]</b>",
        "colorField": "color",
        "labelText": "[[value]]",
        "fillAlphas": 0.85,
        "lineAlpha": 0.1,
        "type": "column",
        "topRadius":1,
        "valueField": "visits"
    }],
    "depth3D": 40,
  "angle": 30,
    "chartCursor": {
        "categoryBalloonEnabled": false,
        "cursorAlpha": 0,
        "zoomable": false
    },
    "categoryField": "country",
    "categoryAxis": {
        "gridPosition": "start",
        "axisAlpha":0,
        "gridAlpha":0

    },
    "export": {
      "enabled": true
     }

}, 0);
</script>

<script type="text/javascript">
// ===== KUNJUNGAN RAWAT INAP by KELAS=====
var kinapkelas = AmCharts.makeChart( "kinapkelas", {
  "type": "pie",
  "theme": "light",
  "dataProvider": [ 
        <?php foreach ($chart_kunjungan_irna_kelas as $content): ?>
        {
            "kelas" : "<?php echo $content->kelas; ?>",
            "value" : <?php echo $content->jumlah; ?>
        },
        <?php endforeach; ?>
  ],
  "valueField": "value",
  "titleField": "kelas",
  "outlineAlpha": 0.4,
  "depth3D": 15,
  "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
  "angle": 30,
  "export": {
    "enabled": true
  }
} );
</script>
