下面的代码用于显示时间表图表并且工作正常,但它不再存在。
目前我们收到错误“您使用错误的数据类型而不是DataTable或DataView调用draw()方法”但我看不出任何明显的原因。
我已经检查了一个类似的问题,建议清除缓存,但这对我的情况不起作用。
有没有人有想法?
<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>