<commit_before><script src="<?php echo base_url('assets/js/highcharts/exporting.js'); ?>"></script>
<script src="<?php echo base_url('assets/js/highcharts/highcharts.js'); ?>"></script>
<script type="text/javascript">
    var options = {
        chart: {
            renderTo: 'grafik-cabai',
            type: 'line'
        },
        title: {
            text: 'Grafik Fluktuasi Harga Cabai di Indonesia',
            x: -20 //center
        },
        subtitle: {
            text: 'Perbandingan Rata-rata Harga Cabai per-Provinsi Tahun <?=$p_tahun;?>',
            x: -20
        },
        xAxis: {
//            categories: [],
            crosshair: true,
            type: 'datetime',
            dateTimeLabelFormats: { // don't display the dummy year
                month: '%e. %b',
                year: '%b'
            },
            title: {
                text: 'Bulan'
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Jumlah (Rp)'
            }
        },
        tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                    '<td style="padding:0"><b>Rp. {point.y:.1f}</b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
        series: []
    };
//        series: []

    $.getJSON("<?php echo base_url(); ?>index.php/fluktuasi_harga/grafik/<?=$p_komoditas?>/<?=$p_tahun?>", function (resp) {
//        {
    //        tahun: 2015,
    //        data: [
        //        {
            //        name: "Aceh",
            //        data: [
                //        {
                //        harga: 14845,
                //        bulan: 5
                //        },
            //        ]
            //    },
        $.each(resp.data, function(i, prov){
//            grafik.yAxis[0].title.text = resp.data.y_label;
            var value = [];
            var legend = prov.name;
            $.each(prov.data, function(j, titik){
//               var date, harga;
               var date = Date.UTC(resp.tahun, titik.bulan);
               var harga = titik.harga;
               value.push([date, harga]);
            });
            
            options.series.push(
                    name: legend,
                    data: value
                );
        });
        chart = new Highcharts.Chart(options);
    });
</script>

<div class="page-content">
<!--    <div class="flex-grid no-responsive-future" style="height: 100%;">
        <div class="row" style="height: 100%">
            <div class="cell size-x200" id="cell-sidebar" style="background-color: #71b1d1; height: 100%">
                <ul class="sidebar">
                    <li class="active">
                        <a href="#">
                            <span class="mif-drive-eta icon"></span>
                            <span class="title">Data Fluktuasi Harga</span>
                        </a>
                    </li><commit_msg>chart fix<commit_after><script src="<?php echo base_url('assets/js/highcharts/exporting.js'); ?>"></script>
<script src="<?php echo base_url('assets/js/highcharts/highcharts.js'); ?>"></script>
<script type="text/javascript">
    var options = {
        chart: {
            renderTo: 'grafik-cabai',
            type: 'line'
        },
        title: {
            text: 'Grafik Fluktuasi Harga Cabai di Indonesia',
            x: -20 //center
        },
        subtitle: {
            text: 'Perbandingan Rata-rata Harga Cabai per-Provinsi Tahun <?=$p_tahun;?>',
            x: -20
        },
        xAxis: {
//            categories: [],
            crosshair: true,
            type: 'datetime',
            dateTimeLabelFormats: { // don't display the dummy year
                month: '%e. %b',
                year: '%b'
            },
            title: {
                text: 'Bulan'
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Jumlah (Rp)'
            }
        },
        tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                    '<td style="padding:0"><b>Rp. {point.y:.1f}</b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
        series: []
    };

    $.getJSON("<?php echo base_url(); ?>index.php/fluktuasi_harga/grafik/<?=$p_komoditas?>/<?=$p_tahun?>", function (resp) {
//        {
    //        tahun: 2015,
    //        data: [
        //        {
            //        name: "Aceh",
            //        data: [
                //        {
                //        harga: 14845,
                //        bulan: 5
                //        },
            //        ]
            //    },
            
        $.each(resp.data, function(i, prov){
            var value = [];           
            var legend = prov.name;
            $.each(prov.data, function(j, titik){
               var date = Date.UTC(resp.tahun, titik.bulan);
               var harga = titik.harga;
               value.push([date, harga]);
            });
            
            options.series.push({
                name: legend,
                data: value
            });
        });
        chart = new Highcharts.Chart(options);
    });
</script>

<div class="page-content">
<!--    <div class="flex-grid no-responsive-future" style="height: 100%;">
        <div class="row" style="height: 100%">
            <div class="cell size-x200" id="cell-sidebar" style="background-color: #71b1d1; height: 100%">
                <ul class="sidebar">
                    <li class="active">
                        <a href="#">
                            <span class="mif-drive-eta icon"></span>
                            <span class="title">Data Fluktuasi Harga</span>
                        </a>
                    </li>
{'fraction_non_alphanumeric': 0.15610824339120913, 'fraction_numerical': 0.01235726575942437, 'mean_word_length': 1.1601351351351352, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '815821', 'n_tokens_mistral': 1932, 'n_tokens_neox': 1829, 'n_words': 348}