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.

57 lines
1.7 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Individual editable items</title>
  5. <style>
  6. body, html {
  7. font-family: arial, sans-serif;
  8. font-size: 11pt;
  9. }
  10. div.vis-editable,
  11. div.vis-editable.vis-selected {
  12. /* custom styling for editable items... */
  13. }
  14. div.vis-readonly,
  15. div.vis-readonly.vis-selected {
  16. /* custom styling for readonly items... */
  17. background-color: #ff4500;
  18. border-color: red;
  19. color: white;
  20. }
  21. </style>
  22. <script src="../../../dist/vis.js"></script>
  23. <link href="../../../dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
  24. <script src="../../googleAnalytics.js"></script>
  25. </head>
  26. <body>
  27. <p>Specify individual items to be editable or readonly.</p>
  28. <div id="visualization"></div>
  29. <script>
  30. // create a DataSet with items
  31. var items = new vis.DataSet([
  32. {id: 1, content: 'Editable', editable: true, start: '2010-08-23'},
  33. {id: 2, content: 'Editable', editable: true, start: '2010-08-23T23:00:00'},
  34. {id: 3, content: 'Read-only', editable: false, start: '2010-08-24T16:00:00'},
  35. {id: 4, content: 'Read-only', editable: false, start: '2010-08-26', end: '2010-09-02'},
  36. {id: 5, content: 'Editable', editable: true, start: '2010-08-28'},
  37. {id: 6, content: 'Read-only', editable: false, start: '2010-08-29'},
  38. {id: 7, content: 'Editable', editable: true, start: '2010-08-31', end: '2010-09-03'},
  39. {id: 8, content: 'Read-only', editable: false, start: '2010-09-04T12:00:00'}
  40. ]);
  41. var container = document.getElementById('visualization');
  42. var options = {
  43. editable: true // default for all items
  44. };
  45. var timeline = new vis.Timeline(container, items, options);
  46. </script>
  47. </body>
  48. </html>