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.

62 lines
2.0 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 groups to highligh groupUpdate
  31. var groups = new vis.DataSet([
  32. {id: 1, content: 'Group 1'},
  33. {id: 2, content: 'Group 2'}
  34. ]);
  35. // create a DataSet with items
  36. var items = new vis.DataSet([
  37. {id: 1, content: 'Editable', editable: true, start: '2010-08-23', group: 1},
  38. {id: 2, content: 'Editable', editable: true, start: '2010-08-23T23:00:00', group: 2},
  39. {id: 3, content: 'Read-only', editable: false, start: '2010-08-24T16:00:00', group: 1},
  40. {id: 4, content: 'Read-only', editable: false, start: '2010-08-26', end: '2010-09-02', group: 2},
  41. {id: 5, content: 'Edit Time Only', editable: { updateTime: true }, start: '2010-08-28', group: 1},
  42. {id: 6, content: 'Edit Group Only', editable: { updateGroup: true }, start: '2010-08-29', group: 2},
  43. {id: 7, content: 'Remove Only', editable: { remove: true }, start: '2010-08-31', end: '2010-09-03', group: 1},
  44. {id: 8, content: 'Default', start: '2010-09-04T12:00:00', group: 2}
  45. ]);
  46. var container = document.getElementById('visualization');
  47. var options = {
  48. editable: true // default for all items
  49. };
  50. var timeline = new vis.Timeline(container, items, groups, options);
  51. </script>
  52. </body>
  53. </html>