Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Simple Gantt</title>
  6. <style>
  7. body {
  8. font-family: sans-serif;
  9. background: #ccc;
  10. }
  11. .container {
  12. width: 80%;
  13. margin: 0 auto;
  14. }
  15. /* custom class */
  16. .gantt .bar-milestone .bar {
  17. fill: tomato;
  18. }
  19. </style>
  20. <link rel="stylesheet" href="dist/xhiveframework-gantt.css" />
  21. <script src="dist/xhiveframework-gantt.js"></script>
  22. </head>
  23. <body>
  24. <div class="container">
  25. <h2>Interactive Gantt Chart entirely made in SVG!</h2>
  26. <div class="gantt-target"></div>
  27. </div>
  28. <script>
  29. var tasks = [
  30. {
  31. start: '2018-10-01',
  32. end: '2018-10-08',
  33. name: 'Redesign website',
  34. id: "Task 0",
  35. progress: 20
  36. },
  37. {
  38. start: '2018-10-03',
  39. end: '2018-10-06',
  40. name: 'Write new content',
  41. id: "Task 1",
  42. progress: 5,
  43. dependencies: 'Task 0'
  44. },
  45. {
  46. start: '2018-10-04',
  47. end: '2018-10-08',
  48. name: 'Apply new styles',
  49. id: "Task 2",
  50. progress: 10,
  51. dependencies: 'Task 1'
  52. },
  53. {
  54. start: '2018-10-08',
  55. end: '2018-10-09',
  56. name: 'Review',
  57. id: "Task 3",
  58. progress: 5,
  59. dependencies: 'Task 2'
  60. },
  61. {
  62. start: '2018-10-08',
  63. end: '2018-10-10',
  64. name: 'Deploy',
  65. id: "Task 4",
  66. progress: 0,
  67. dependencies: 'Task 2'
  68. },
  69. {
  70. start: '2018-10-11',
  71. end: '2018-10-11',
  72. name: 'Go Live!',
  73. id: "Task 5",
  74. progress: 0,
  75. dependencies: 'Task 4',
  76. custom_class: 'bar-milestone'
  77. },
  78. {
  79. start: '2014-01-05',
  80. end: '2019-10-12',
  81. name: 'Long term task',
  82. id: "Task 6",
  83. progress: 0
  84. }
  85. ]
  86. var gantt_chart = new Gantt(".gantt-target", tasks, {
  87. on_click: function (task) {
  88. console.log(task);
  89. },
  90. on_date_change: function(task, start, end) {
  91. console.log(task, start, end);
  92. },
  93. on_progress_change: function(task, progress) {
  94. console.log(task, progress);
  95. },
  96. on_view_change: function(mode) {
  97. console.log(mode);
  98. },
  99. view_mode: 'Month',
  100. language: 'en'
  101. });
  102. console.log(gantt_chart);
  103. </script>
  104. </body>
  105. </html>