<script src="<?php echo base_url();?>resources/js/hichart/highcharts.js"></script>
<script src="<?php echo base_url();?>resources/js/hichart/modules/data.js"></script>
<script src="<?php echo base_url();?>resources/js/hichart/modules/exporting.js"></script>
<script src="<?php echo base_url();?>resources/js/hichart/themes/sand-signika.js"></script>

<div align="left" style="height:100%; width: 100%">
    <div id="grafik_mediasi" style="width:95%;min-width: 310px; height: 80%; margin: 5% auto"></div>
</div>

<br/>
<div class="cssTable">
        <table id="statistik_mediasi">
                <col  width="40%" />
                <col  width="15%" />
                <col  width="15%" />
                <col  width="15%" />
                <col  width="15%" />
                <tbody>
                        <tr>
                                <td>Bulan</td>
                                <td>Akta Perdamaian/Putusan</td>                                
                                <td>Berhasil Sebagian</td>                                
                                <td>Pencabutan</td>                                
                                <td>Tidak Berhasil</td>                                
                                <td>Tidak dapat dilaksanakan</td>                                

                        </tr>
                        <?php
                        if($rekap->num_rows>0){
                                foreach ($rekap->result() as $row) {
                                        echo "<tr>";
												echo "<td style ='text-align:center'>".$row->bulan_nama."</td>";
												echo "<td style ='text-align:center'>".$row->mediasi_berhasil_akta."</td>";												
												echo "<td style ='text-align:center'>".$row->mediasi_berhasil_sebagian."</td>";
                                                echo "<td style ='text-align:center'>".$row->mediasi_berhasil_pencabutan."</td>";
                                                echo "<td style ='text-align:center'>".$row->mediasi_tdk_berhasil."</td>";
                                                echo "<td style ='text-align:center'>".$row->mediasi_tdk_dpt_dilaksanakan."</td>";
                                        echo "</tr>";
                                }
                        }
                        ?>
                </tbody>
        </table>
      
</div>
<script>
$('#statistik_mediasi').hide();

    $('#grafik_mediasi').highcharts({
        data: {
            table: document.getElementById('statistik_mediasi'),
            switchRowsAndColumns: true
        },
        chart: {
            type: 'column',

        },
        plotOptions: {
        column: {
        dataLabels: {
            enabled: true,
            }
            }
        },
        title: {
            text: 'Grafik Jumlah Perkara Diterima dan Mediasi'
        },
        yAxis: {
            allowDecimals: false,
            title: {
                text: 'Jumlah'
            }
        },
        tooltip: {
            formatter: function() {
                return '<b>'+ this.series.name +'</b><br/>'+
                    this.point.y +' '+ this.point.name.toLowerCase();
            }
        }
    });

</script>

