0
votes

$.ajax({ type: "POST", url: "/Login/GetAllAciveProject", data: '{ CountryId: 1}', contentType: "application/json; charset=utf-8", dataType: "json", success: function (r) {

                            var data11 = [];
                            var Header = ['Name', 'On Time Projects', { role: 'annotation' }, 'Delayed Projects', { role: 'annotation' }];

                            data11.push(Header);
                            debugger;
                            for (var i = 0; i < r.length; i++) {
                                var temp = [];
                                temp.push(r[i].Name);
                                temp.push(r[i].TotalDays);
                                temp.push("");
                                temp.push(null);
                                temp.push("");                                   
                                data11.push(temp);

                            }

                           // need arry like this --> ['Aarav', 10, '', , ''],

                            debugger;
                            var data = google.visualization.arrayToDataTable(data11);
                            var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
                            chart.draw(data, options);
                        },
                        failure: function (r) {
                            alert(r.d);
                        },
                        error: function (r) {
                            alert(r.d);
                        }
                    });
1

1 Answers

1
votes

Just define the element as undefined:

var arr = ['Aarav', 10, '', undefined, ''];