0

$.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 Answer 1

1

Just define the element as undefined:

var arr = ['Aarav', 10, '', undefined, ''];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.