
//        $(document).ready(function () {
//   
//            $.ajax({
//                type: "POST",
//                contentType: "application/json; charset=utf-8",
//                url: "Services/chartservice.asmx/GetTotAmtByMonth",
//                data: "{}",
//                dataType: "json",
//                success: function (Result) {

//                    Result = Result.d;
//                    var data = [];
//                    var data1 = [];

//                    for (var i in Result) {
//                        var serie = { name:Result[i].Month ,y: Result[i].amount  };
//                          //  var ses1={ Result[i].amount  };
//                           data.push(serie);
//                    

//                          alert(JSON.stringify(serie));
//                         // data1.push(ses1);
//                        //alert(JSON.stringify(ses1));
//                        
//                    }

//                    BindChart(data);
//                },
//                error: function (Result)
//                 {
//                    alert("Error");
//                }
//            });
//        });

//        function BindChart(seriesArr) {
//         alert(JSON.stringify(seriesArr));
//         //alert(JSON.stringify(AmountArr));


//            $('#Div1').highcharts({
//                chart: {                   
//                    type: 'column',
//                    backgroundColor: '#FFFFFF',
//                    borderColor: '#6495ED',
//                    borderWidth:0,
//                    className: 'dark-container',
//                    plotBackgroundColor: '#FFFFFF',
//                    plotBorderColor: '#6495ED',
//                    plotBorderWidth: 0,                     
//                    events: {
//                        drilldown: function (e) {
//                            if (!e.seriesOptions) {                            
//                                var chart = this;
//                                chart.showLoading('Loading Quarter wise Revenue ...');
//                                var dataArr = CallChild(e.point.name);
//                                chart.setTitle({
//                                    text: 'Quarter wise Revenue Report'
//                                });                                
//                                data = {
//                                    name: e.point.name,
//                                    data: dataArr,
//                                                                      
//                                }
//                                setTimeout(function () {
//                                    chart.hideLoading();
//                                    chart.addSeriesAsDrilldown(e.point, data);
//                                }, 1000);
//                            }
//                        }
//                    }
//                },
//                title: {
//                    text: 'Year wise Revenue Report'
//                },
//                xAxis: {
//                    type: 'category', 
//                       labels: {
//                rotation: -45,
//               style: {
//               
//                fontSize: '13px',
//                fontFamily: 'Verdana, sans-serif'
//               
//                }
//              }
//               
//          },


//                plotOptions: {                
//                    series: {
//                        borderWidth: 0,
//                        dataLabels: {
//                            enabled: true,
//                            rotation: -90,
//                              align: 'right',
//                              format: '{point.y:.2f}',
//                              y: 10,
//                              style: {
//                                  fontSize: '10px',
//                                  fontFamily: 'Verdana, sans-serif' ,
//                                  
//                              }

//                        }
//                    }
//                },
//                
//                series: [{
//                    name: 'Year',
//                    colorByPoint: false,
//                    pointWidth: 50,
//                   data: seriesArr
//                    
//                }],
//               
//                drilldown: {
//                    series: [{
//                      pointWidth: 80
//                    }]
//                }
//            });
//        }

//        function CallChild(name) {
//            var Drilldowndata = [];
//            $.ajax({
//                type: "POST",
//                contentType: "application/json; charset=utf-8",
//                url: "Services/WebServiceChart.asmx/GetRevenueByQuarter",
//                data: JSON.stringify({ year: name }),
//                dataType: "json",
//                success: function (Result) {
//                    Result = Result.d;
//                    for (var i in Result) {
//                        var serie = { name: Result[i].year, y: Result[i].amount };
//                        Drilldowndata.push(serie);
//                    }
//                },
//                error: function (Result) {
//                    alert("Error");
//                }
//            })
//            return Drilldowndata;
//        }

(function(window, document, $, undefined) {
        "use strict";
        $(function() {

                if ($('#chartjs_line').length) {
                    var ctx = document.getElementById('chartjs_line').getContext('2d');

                    var myChart = new Chart(ctx, {
                            type: 'line',

                            data: {
                                labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                                datasets: [{
                                    label: 'Almonds',
                                    data: [12, 19, 3, 17, 6, 3, 7],

                                    backgroundColor: "rgba(89, 105, 255,0.5)",
                                    borderColor: "rgba(89, 105, 255,0.7)",
                                    borderWidth: 2
                                }, {
                                    label: 'Cashew',
                                    data: [2, 29, 5, 5, 2, 3, 10],
                                    backgroundColor: "rgba(255, 64, 123,0.5)",
                                    borderColor: "rgba(255, 64, 123,0.7)",
                                    borderWidth: 2
                                }]

                            },
                            options: {
                                legend: {
                                    display: true,
                                    position: 'bottom',

                                    labels: {
                                        fontColor: '#71748d',
                                        fontFamily: 'Circular Std Book',
                                        fontSize: 14,
                                    }
                                },

                                scales: {
                                    xAxes: [{
                                        ticks: {
                                            fontSize: 14,
                                            fontFamily: 'Circular Std Book',
                                            fontColor: '#71748d',
                                        }
                                    }],
                                    yAxes: [{
                                        ticks: {
                                            fontSize: 14,
                                            fontFamily: 'Circular Std Book',
                                            fontColor: '#71748d',
                                        }
                                    }]
                                }
                            }
                        


                    });
            }

                   var serie;
                   var data = [];
                    var data1 = [];
            if ($('#chartjs_bar').length) {            
              

                var ctx = document.getElementById("chartjs_bar").getContext('2d');     
                
                  $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "Services/chartservice.asmx/GetTotAmtByMonth",
                data: "",
                dataType: "json",
                success: function (Result) {

                    Result = Result.d;
                   // alert(JSON.stringify(Result));

                  

                    for (var i in Result) {
                        //var serie = { name:Result[i].Month ,y: Result[i].amount  };
                       serie = Result[i].amount ;
                          //  var ses1={ Result[i].amount  };
                           data.push(serie);                                               
                    }
                   //  alert(JSON.stringify(data));
                    //BindChart(data);
                                     },               
                error: function (Result)
                 {
                    alert("Error");
                }               
             });       
                    
                     //alert(JSON.stringify(data));
                            
                var myChart = new Chart(ctx, {
                    type: 'bar',
                    data: {
                        labels: ["January","February ","March","Apri","May","June","July","August","September","October ","November","December"],
                                     
                        datasets: [{
                            label: 'Almonds',
                           data:  ["353521","339844","339844","339844","339844","339844","339844","339844","339844","339844","339844","339844"],                                                      
                           backgroundColor: "rgba(89, 105, 255,0.5)",
                           borderColor: "rgba(89, 105, 255,0.7)",
                            borderWidth: 2
                        }, {
                           label: 'Cashew',
                           // data: [30, 29, 5, 5, 20, 3, 10],
                           backgroundColor: "rgba(255, 64, 123,0.5)",
                                    borderColor: "rgba(255, 64, 123,0.7)",
                            borderWidth: 2
                        }]
                    },
                    options: {
                        scales: {
                            yAxes: [{

                            }]
                        },
                             legend: {
                        display: true,
                        position: 'bottom',

                        labels: {
                            fontColor: '#71748d',
                            fontFamily: 'Circular Std Book',
                            fontSize: 14
                        }
                    },

                    scales: {
                        xAxes: [{
                            ticks: {
                                fontSize: 14,
                                fontFamily: 'Circular Std Book',
                                fontColor: '#71748d',
                            }
                        }],
                        yAxes: [{
                            ticks: {
                                fontSize: 14,
                                fontFamily: 'Circular Std Book',
                                fontColor: '#71748d',
                            }
                        }]
                    }
                }


                });
             

            }

            if ($('#chartjs_radar').length) {
                var ctx = document.getElementById("chartjs_radar");
                var myChart = new Chart(ctx, {
                    type: 'radar',
                    data: {
                        labels: ["M", "T", "W", "T", "F", "S", "S"],
                        datasets: [{
                            label: 'Almonds',
                           backgroundColor: "rgba(89, 105, 255,0.5)",
                                    borderColor: "rgba(89, 105, 255,0.7)",
                            data: [12, 19, 3, 17, 28, 24, 7],
                            borderWidth: 2
                        }, {
                            label: 'Cashew',
                             backgroundColor: "rgba(255, 64, 123,0.5)",
                                    borderColor: "rgba(255, 64, 123,0.7)",
                            data: [30, 29, 5, 5, 20, 3, 10],
                            borderWidth: 2
                        }]
                    },
                    options: {
                       
                             legend: {
                        display: true,
                        position: 'bottom',

                        labels: {
                            fontColor: '#71748d',
                            fontFamily: 'Circular Std Book',
                            fontSize: 14,
                        }
                    },

                    
                }

                });
            }


            if ($('#chartjs_polar').length) {
                var ctx = document.getElementById("chartjs_polar").getContext('2d');
                var myChart = new Chart(ctx, {
                    type: 'polarArea',
                    data: {
                        labels: ["M", "T", "W", "T", "F", "S", "S"],
                        datasets: [{
                            backgroundColor: [
                                "#5969ff",
                                "#ff407b",
                                "#25d5f2",
                                "#ffc750",
                                "#2ec551",
                                "#7040fa",
                                "#ff004e"
                            ],
                            data: [12, 19, 3, 17, 28, 24, 7]
                        }]
                    },
                    options: {
                        
                             legend: {
                        display: true,
                        position: 'bottom',

                        labels: {
                            fontColor: '#71748d',
                            fontFamily: 'Circular Std Book',
                            fontSize: 14,
                        }
                    },

                    
                }
                });
            }


            if ($('#chartjs_pie').length) {
                var ctx = document.getElementById("chartjs_pie").getContext('2d');
                var myChart = new Chart(ctx, {
                    type: 'pie',
                    data: {
                        labels: ["M", "T", "W", "T", "F", "S", "S"],
                        datasets: [{
                            backgroundColor: [
                               "#5969ff",
                                "#ff407b",
                                "#25d5f2",
                                "#ffc750",
                                "#2ec551",
                                "#7040fa",
                                "#ff004e"
                            ],
                            data: [12, 19, 3, 17, 28, 24, 7]
                        }]
                    },
                    options: {
                           legend: {
                        display: true,
                        position: 'bottom',

                        labels: {
                            fontColor: '#71748d',
                            fontFamily: 'Circular Std Book',
                            fontSize: 14,
                        }
                    },

                    
                }
                });
            }


            if ($('#chartjs_doughnut').length) {
                var ctx = document.getElementById("chartjs_doughnut").getContext('2d');
                var myChart = new Chart(ctx, {
                    type: 'doughnut',
                    data: {
                        labels: ["M", "T", "W", "T", "F", "S", "S"],
                        datasets: [{
                            backgroundColor: [
                                 "#5969ff",
                                "#ff407b",
                                "#25d5f2",
                                "#ffc750",
                                "#2ec551",
                                "#7040fa",
                                "#ff004e"
                            ],
                            data: [12, 19, 3, 17, 28, 24, 7]
                        }]
                    },
                    options: {

                             legend: {
                        display: true,
                        position: 'bottom',

                        labels: {
                            fontColor: '#71748d',
                            fontFamily: 'Circular Std Book',
                            fontSize: 14,
                        }
                    },

                    
                }

                });
            }


        });


})(window, document, window.jQuery);


    



