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.

49 lines
1.2 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Tooltips</title>
  5. <style type="text/css">
  6. body, html {
  7. font-family: sans-serif;
  8. max-width: 800px;
  9. }
  10. </style>
  11. <script src="../../../dist/vis.js"></script>
  12. <link href="../../../dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
  13. <script src="../../googleAnalytics.js"></script>
  14. </head>
  15. <body>
  16. <h1>Tooltips</h1>
  17. <p>
  18. Setting the tooltip in various ways.
  19. </p>
  20. <div id="tooltips"></div>
  21. <script type="text/javascript">
  22. // Create a DataSet (allows two way data-binding)
  23. var items = new vis.DataSet([
  24. {id: 1, content: 'Item 1', start: '2016-01-01', end: '2016-01-02',
  25. title: 'Normal text'},
  26. {id: 2, content: 'Item 2', start: '2016-01-02', title: '<b>Bold</b>'},
  27. {id: 3, content: 'Item 3', start: '2016-01-03', type: 'point',
  28. title: '<span style="color: red">Red</span> text'},
  29. {id: 4, content: '<h1>HTML</h1> Item', start: '2016-01-03', end: '2016-01-04',
  30. title: '<table border="1"><tr><td>Cell 1</td><td>Cell 2</td></tr></table>'}
  31. ]);
  32. // Options
  33. var options = {};
  34. // Timeline object
  35. var timelineTooltips = new vis.Timeline(document.getElementById('tooltips'),
  36. items, options
  37. );
  38. </script>
  39. </body>
  40. </html>