<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('sweet::alert', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

    <h1 class="page-title">
        Reporte estadístico de trámites realizados en el año
    </h1>

    <div class="portlet light portlet-fit portlet-datatable bordered">

        <div class="portlet-body">

            <div class=" row" style="padding-top: 3%;">
                <div class="col-lg-12 ">
                    <div class="row">
                        <div class="col-lg-12" style="text-align: center;">
                            <span class="caption-subject font-green sbold uppercase"> Tramites iniciados vs finalizados por mes </span>
                            <div id="graph1">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

    </div>


<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
    <script>

        $(document).ready(function () {

            var color_array = ['#03658C', '#7CA69E', '#F2594A', '#F28C4B', '#7E6F6A', '#36AFB2', '#9c6db2', '#d24a67', '#89a958', '#00739a', '#BDBDBD'];


            //-------------Graph-----------------

            $.ajax({
                url: "<?php echo e(url('graph/tramites')); ?>",
                type: "GET",
                success: function (result) {
                    $("#graph1").empty();

                    if (result.length <= 0) {
                        $("#graph1").html("<div class='well' style='text-align: center;'> No se tiene información registrada</div>");
                    } else {
                        var data = result,
                            config = {
                                data: data,
                                xkey: 'y',
                                ykeys: ['a', 'b'],
                                labels: ['Iniciados', 'Finalizados'],
                                fillOpacity: 0.6,
                                hideHover: 'auto',
                                behaveLikeLine: true,
                                resize: true,
                                pointFillColors: ['#ffffff'],
                                pointStrokeColors: ['black'],
                                lineColors: ['gray', 'red']
                            };
                        config.element = 'graph1';
                        Morris.Bar(config);
                        config.stacked = true;
                    }


                }
            });

            //-------------Fin Graph-------------


        });

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('template.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>