vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Tooltips</title>
  5. <style type="text/css">
  6. /* http://www.menucool.com/tooltip/css-tooltip */
  7. a.tooltip {outline:none; }
  8. a.tooltip strong {line-height:30px;}
  9. a.tooltip:hover {text-decoration:none;}
  10. a.tooltip span {
  11. z-index:10;display:none; padding:14px 20px;
  12. margin-top:-30px; margin-left:28px;
  13. width:300px; line-height:16px;
  14. }
  15. a.tooltip:hover span{
  16. display:inline; position:absolute; color:#111;
  17. border:1px solid #DCA; background:#fffAF0;}
  18. .callout {z-index:20;position:absolute;top:30px;border:0;left:-12px;}
  19. /*CSS3 extras*/
  20. a.tooltip span
  21. {
  22. border-radius:4px;
  23. box-shadow: 5px 5px 8px #CCC;
  24. }
  25. </style>
  26. <script src="../../../dist/vis.js"></script>
  27. <link href="../../../dist/vis.css" rel="stylesheet" type="text/css" />
  28. <script src="../../googleAnalytics.js"></script>
  29. </head>
  30. <body>
  31. <p>
  32. Show tooltips when hovering items using a CSS tooltip library or your own custom CSS.
  33. </p>
  34. <div id="visualization"></div>
  35. <script type="text/javascript">
  36. // DOM element where the Timeline will be attached
  37. var container = document.getElementById('visualization');
  38. // Create a DataSet (allows two way data-binding)
  39. var items = new vis.DataSet([
  40. {id: 1, content: 'item 1', start: '2014-04-20'},
  41. {id: 2, content: 'item 2', start: '2014-04-14'},
  42. {id: 3, content: 'item 3', start: '2014-04-18'},
  43. {id: 4, content: 'item 4', start: '2014-04-16', end: '2014-04-19'},
  44. {id: 5, content: 'item 5', start: '2014-04-25'},
  45. {id: 6, content: 'item 6', start: '2014-04-27', type: 'point'}
  46. ]);
  47. // Configuration for the Timeline
  48. var options = {};
  49. // Create a Timeline
  50. var timeline = new vis.Timeline(container, items, options);
  51. </script>
  52. </body>
  53. </html>