Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  2.  
  3. <script type="text/javascript">
  4. google.charts.load("current", {packages:["timeline"]});
  5. google.charts.setOnLoadCallback(drawChart);
  6. function drawChart() {
  7.  
  8. var container = document.getElementById('example3.1');
  9. var chart = new google.visualization.Timeline(container);
  10. var dataTable = new google.visualization.DataTable();
  11. dataTable.addColumn({ type: 'string', id: 'Position' });
  12. dataTable.addColumn({ type: 'string', id: 'Name' });
  13. dataTable.addColumn({ type: 'date', id: 'Start' });
  14. dataTable.addColumn({ type: 'date', id: 'End' });
  15. dataTable.addRows([
  16. [ 'President', 'George Washington', new Date(1789, 3, 30), new Date(1797, 2, 4) ],
  17. [ 'President', 'John Adams', new Date(1797, 2, 4), new Date(1801, 2, 4) ],
  18. [ 'President', 'Thomas Jefferson', new Date(1801, 2, 4), new Date(1809, 2, 4) ],
  19. [ 'Vice President', 'John Adams', new Date(1789, 3, 21), new Date(1797, 2, 4)],
  20. [ 'Vice President', 'Thomas Jefferson', new Date(1797, 2, 4), new Date(1801, 2, 4)],
  21. [ 'Vice President', 'Aaron Burr', new Date(1801, 2, 4), new Date(1805, 2, 4)],
  22. [ 'Vice President', 'George Clinton', new Date(1805, 2, 4), new Date(1812, 3, 20)],
  23. [ 'Secretary of State', 'John Jay', new Date(1789, 8, 25), new Date(1790, 2, 22)],
  24. [ 'Secretary of State', 'Thomas Jefferson', new Date(1790, 2, 22), new Date(1793, 11, 31)],
  25. [ 'Secretary of State', 'Edmund Randolph', new Date(1794, 0, 2), new Date(1795, 7, 20)],
  26. [ 'Secretary of State', 'Timothy Pickering', new Date(1795, 7, 20), new Date(1800, 4, 12)],
  27. [ 'Secretary of State', 'Charles Lee', new Date(1800, 4, 13), new Date(1800, 5, 5)],
  28. [ 'Secretary of State', 'John Marshall', new Date(1800, 5, 13), new Date(1801, 2, 4)],
  29. [ 'Secretary of State', 'Levi Lincoln', new Date(1801, 2, 5), new Date(1801, 4, 1)],
  30. [ 'Secretary of State', 'James Madison', new Date(1801, 4, 2), new Date(1809, 2, 3)]
  31. ]);
  32.  
  33. chart.draw(dataTable);
  34. }
  35. </script>
  36.  
  37. <div id="example3.1" style="height: 200px;"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement