$(document).ready(function(){


        $.ajax({
        url: "./ajax/dashboard/shipments/load_graphics_shipments_pie_chart_ajax.php",
        method:"POST",
        dataType:"JSON",
        success: function (data) {

            console.log( ObjectLength(data) );


            var status_invoice = [];
            var total = [];


            for(var i = 0; i < data.length; i++)
            {
                status_invoice.push(data[i].status_invoice);
                total.push(data[i].total);
            }

            var chart_data = {
                labels: ["Paid", "Pending"],
                datasets:[
                    {
                    label:'Transaction',
                    backgroundColor: ["#4fc3f7", "#fb8c00"],
                    color:'#fff',
                    data:total

                    }
                ]
            };

            var options = {
                responsive:true,
                scales:{
                    yAxes:[{
                        ticks:{
                            min:0
                        }
                    }]
                }
            };

            var group_chart2 = $('#doughnut_chart');

            var graph2 = new Chart(group_chart2, {
                type:"doughnut",
                data:chart_data
            })

   

        },
        error: function (data) {

        },
  });

  cdp_load(1);

});