Seems your problem is with below code:
success: function (r) {
var data = google.visualization.arrayToDataTable(r.d);
data.addColumn('string', 'SelectedDate');
data.addColumn('number', 'Line');
var chart = new google.visualization.LineChart($("#chart")[0]);
chart.draw(data, options);
}
Don't think data returned as list will automatically be interpreted and used. You would need to defined the data on client side.
Documentation[
^] says:
var data = new google.visualization.DataTable(jsonData);
So, you have two options, pass json string from server OR create a JSON string on client side.
Option 2 would be something like:
success: function (data) {
var arrValues = [['SelectedDate', 'Line']];
var iCnt = 0;
$.each(data.d, function () {
arrValues.push([data.d[iCnt].SelectedDate, data.d[iCnt].Line]);
iCnt += 1;
});
var data = google.visualization.arrayToDataTable(arrValues);
data.addColumn('string', 'SelectedDate');
data.addColumn('number', 'Line');
...
...
}
Referring:
Create a Google Pie Chart using dynamic data and Web Service[
^]
For above case, best would be to DEBUG. With help of debugger, you will have clue on how-tos execution is happening and the data retrieved. You would need to do this, would be difficult for anyone else to help with it.