问题描述
我使用的是 Google 时间轴图表,这很好,但在第一列中出现了三个问题:
我的代码如下:
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current",{packages:["timeline"]});
google.charts.setonLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('example2.1');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string',id: 'Position' });
dataTable.addColumn({ type: 'string',id: 'Name' });
dataTable.addColumn({ type: 'date',id: 'Start' });
dataTable.addColumn({ type: 'date',id: 'End' });
dataTable.addRows([
[ 'President','George Washington',new Date(1789,3,30),new Date(1797,2,4) ],[ 'President','John Adams',4),new Date(1801,'Thomas Jefferson',new Date(1809,[ 'Vice President',21),4)],'Aaron Burr',new Date(1805,'George Clinton',new Date(1812,20)],[ 'Secretary of State','John Jay',8,25),new Date(1790,22)],22),new Date(1793,11,31)],'Edmund Randolph',new Date(1794,2),new Date(1795,7,'Timothy Pickering',20),new Date(1800,4,12)],[ 'Bleeding Protocol<br/><div class="assmInfoData">Access,Complement,Factor Xa,Andexxa</div>','Charles Lee',13),5,5)],'John Marshall',[ 'Account part of the REMS/emergency stock program?<br/><div class="assmInfoData">General,Obtained from account</div>','Levi Lincoln',5),1)],[ 'Secretary of State <br> A good state','James Madison',3)]
]);
chart.draw(dataTable);
}
</script>
<div id="example2.1" style="height: 400px;"></div>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)