i am counting my learning of using google charts
i have a sql 2014 backend that i receive a query from and format in in xbasic to produce the array
{dialog.object}._TimeLine =['Barbee B 2-1 #4SU','Pending',new Date(2017,12,1),new Date(2017,12,11)],
['Barbee B 2-1 #5SU','Pending',new Date(2017,12,1),new Date(2017,12,11)],
['Barbee B 2-6 #2SU','Pending',new Date(2017,12,17),new Date(2017,12,31)],
['Barbee B 2-6 #3SU','Pending',new Date(2017,12,17),new Date(2017,12,31)],
['Baree B 2-1 #6SU','Pending',new Date(2017,12,13),new Date(2017,12,27)],
['Baree B 2-1 #7SU','Pending',new Date(2017,12,13),new Date(2017,12,27)],
['BearKat 8-5 #1NC','Pending',new Date(2017,11,30),new Date(2017,12,15)],
['BearKat 8-5 #4NC','Pending',new Date(2017,12,1),new Date(2017,12,15)],
['Sugg B 133-135 #2MB','Pending',new Date(2017,12,29),new Date(2018,1,8)],
['Sugg B 133-135 #2RF','Pending',new Date(2017,12,29),new Date(2018,1,8)],
['Sugg D 105 #1NM','Pending',new Date(2017,12,1),new Date(2017,12,22)],
['Sugg D 105 #1NU','Pending',new Date(2017,12,1),new Date(2017,12,22)],
['Sugg D 105 #2NM','Pending',new Date(2017,12,1),new Date(2017,12,22)];
i take this and plug into the foloowing code
function doTimeline() {
google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('JobStaus');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Well' });
dataTable.addColumn({ type: 'string', id: 'Status' });
dataTable.addColumn({ type: 'date', id: 'StartDate' });
dataTable.addColumn({ type: 'date', id: 'EndDate' });
dataTable.addRows([
{dialog.object}._TimeLine
]);
chart.draw(dataTable);
}
}
when i execute the code draws the chart, but only the first record in the table. it is not doing the a parse of the full table.
what am i missing
i have a sql 2014 backend that i receive a query from and format in in xbasic to produce the array
{dialog.object}._TimeLine =['Barbee B 2-1 #4SU','Pending',new Date(2017,12,1),new Date(2017,12,11)],
['Barbee B 2-1 #5SU','Pending',new Date(2017,12,1),new Date(2017,12,11)],
['Barbee B 2-6 #2SU','Pending',new Date(2017,12,17),new Date(2017,12,31)],
['Barbee B 2-6 #3SU','Pending',new Date(2017,12,17),new Date(2017,12,31)],
['Baree B 2-1 #6SU','Pending',new Date(2017,12,13),new Date(2017,12,27)],
['Baree B 2-1 #7SU','Pending',new Date(2017,12,13),new Date(2017,12,27)],
['BearKat 8-5 #1NC','Pending',new Date(2017,11,30),new Date(2017,12,15)],
['BearKat 8-5 #4NC','Pending',new Date(2017,12,1),new Date(2017,12,15)],
['Sugg B 133-135 #2MB','Pending',new Date(2017,12,29),new Date(2018,1,8)],
['Sugg B 133-135 #2RF','Pending',new Date(2017,12,29),new Date(2018,1,8)],
['Sugg D 105 #1NM','Pending',new Date(2017,12,1),new Date(2017,12,22)],
['Sugg D 105 #1NU','Pending',new Date(2017,12,1),new Date(2017,12,22)],
['Sugg D 105 #2NM','Pending',new Date(2017,12,1),new Date(2017,12,22)];
i take this and plug into the foloowing code
function doTimeline() {
google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('JobStaus');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Well' });
dataTable.addColumn({ type: 'string', id: 'Status' });
dataTable.addColumn({ type: 'date', id: 'StartDate' });
dataTable.addColumn({ type: 'date', id: 'EndDate' });
dataTable.addRows([
{dialog.object}._TimeLine
]);
chart.draw(dataTable);
}
}
when i execute the code draws the chart, but only the first record in the table. it is not doing the a parse of the full table.
what am i missing
Comment