UNPKG

suivi-dhx-trial-gantt

Version:

An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.

69 lines (60 loc) 1.38 kB
<!DOCTYPE html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Task styles</title> <script src="../../codebase/dhtmlxgantt.js?v=9.0.7"></script> <link rel="stylesheet" href="../../codebase/dhtmlxgantt.css?v=9.0.7"> <script src="../common/testdata.js?v=9.0.7"></script> <style> html, body { height: 100%; padding: 0px; margin: 0px; overflow: hidden; } .high { --dhx-gantt-task-background: #d96c49; } .medium { --dhx-gantt-task-background: #34c461; } .low { --dhx-gantt-task-background: #6ba8e3; } </style> </head> <body> <div id="gantt_here" style='width:100%; height:100%;'></div> <script> gantt.init("gantt_here"); gantt.config.columns = [ {name: "text", label: "Task name", tree: true, width: "*", resize: true}, {name: "start_date", label: "Start time", align: "center", resize: true}, { name: "priority", label: "Priority", align: "center", template: function (obj) { if (obj.priority == 1) { return "High" } if (obj.priority == 2) { return "Medium" } return "Low" } } ]; gantt.templates.task_class = function (start, end, task) { switch (task.priority) { case "1": return "high"; break; case "2": return "medium"; break; case "3": return "low"; break; } }; gantt.parse(users_data); </script> </body>