Google charts You called the draw () method with the wrong datatype, not a DataTable or DataView
the code below is used to display a timeline graph and it worked fine but it is no longer the case.
We are currently getting the error "You called draw () with the wrong data type, not a DataTable or DataView", but I see no obvious reason for this.
I checked a similar question that suggested clearing the cache, but that didn't work in my case.
Does anyone have any ideas?
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['timeline']}]}">
</script>
<script type="text/javascript">
google.setOnLoadCallback(drawChartViewOne);
function drawChartViewOne() {
var container = document.getElementById('viewExampleOne');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Date' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'Submission Date', new Date('2007-08-02'), new Date('2007-08-03') ],
[ 'Priority Date', new Date('2007-08-02'), new Date('2007-09-03') ],
[ 'Classification Version D.', new Date('2008-08-02'), new Date('2008-08-03') ],
[ 'Classification Action D.', new Date('2008-08-02'), new Date('2008-08-03') ],
[ 'Production Date', new Date('2008-07-02'), new Date('2008-08-03') ],
[ 'Provisional Approval D.', new Date('2009-08-12'), new Date('2009-09-03') ],
[ 'Related Publication D.', new Date('2009-08-12'), new Date('2009-10-03') ],
[ 'Publication Date', new Date('2009-08-12'), new Date('2009-08-23') ]
]);
var options = {
height:400
};
chart.draw(dataTable,options);
}
</script>
+3
source to share
No one has answered this question yet
Check out similar questions: