gantt charts & dependencies
lefnire - August 20, 2008 - 18:32
| Project: | Storm |
| Version: | 6.x-1.x-dev |
| Component: | Storm Task |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
+1 for gantt charts (i think that was already on your todo) as well as dependencies (certain tasks can't begin until others are completed, etc).

#1
subscribe - I'd like to see Gantt Charts also. It helps clear things up.
#2
subscribe
#3
subscribe
#4
+1
subscribe
#5
subscribe
#6
subscribe
#7
+1
and thanks for the effort so far, great module!
#8
+1 for Gantt, dependencies, and deadlines. I use Storm for new small projects based on Drupal, dotproject for some larger existing projects not based on Drupal, and have used a lot of other project management software. The really hard thing to explain to the decision makers is the fact that they set a deadline of 10 weeks but their decision making process will waste the first 9 weeks. Gantt charts and similar reports help explain how the timeline will become impossible.
If a customer pays for the delivery of the project in 12 weeks from now and the work will take 10 weeks, there is not enough time to put off the decision until the board meeting 3 weeks from now. The contractor cannot start the day after the board meeting, which means we need two contractors for 5 weeks instead of one for 10 weeks. Without that sort of reporting, some management will put off the decision until the second last day then expect you to complete 10 weeks work by using 50 contractors for 1 day.
There is a Gantt component for Jquery at http://www.maro-z.com/examples/jquery.gantt/. A PHP component would be better because the output could be converted to several forms using the Drupal module for converting output. The dotproject gantt code might be a good starting point.
Dependencies are harder because you can have a range of possible resources. We have several contractors lined up for one project and each week one of the contractors calls to say he or she is now booked out for weeks or months. At times I explain to people that module B cannot be started until module A is finished because module B requires the output from module A. Some manager gives me a blank look then says ok, but module B has a higher priority so do not start on module A until after you finish module B.
Deadlines are easier. You type in the IP address for every computer belonging to the decision making management and set the deadline. When they fail to make the decision at the critical time, call the Drupal High Tension API to send a 20 thousand volt reminder through their keyboards. :-)
#9
When they fail to make the decision at the critical time, call the Drupal High Tension API to send a 20 thousand volt reminder through their keyboards.
Ooooh! I like it!! Can this be split off as a separate function?
#10
Probably should use the status module to assure they are at the desk before the voltage is called upon. :-)
Also, some great ideas on the Gantt stuff. Neat that a jquery module exists.
#11
Thanks for the jquery suggestion, but I think Strom we'll need also other charts, so
I think to integrate http://www.aditus.nu/jpgraph/ library.
Gantt examples : http://www.aditus.nu/jpgraph/features_gallery.php#GanttPlots
#12
There is a free version but it cannot be used in sites that charge for use of the site. Is there a free graph library anywhere?
#13
Good old sourceforge:
http://graphpite.sourceforge.net/
http://pchart.sourceforge.net/
#14
subscribing
#15
subscribing
#16
subscribing
#17
I like that pcharts... It even charts live data, plus its pretty.
Still cant help but think flash charts would be better cause there a little more dynamic with dialog pop-ups n stuff.
http://teethgrinder.co.uk/open-flash-chart/
Anyone here using Storm in production? ...or close?
#18
It looks from my preliminary inspection that JpGraph is the only graph library out of the ones mentioned that natively supports Gantt charts (or perhaps I missed it). Although I do understand that most users will probably be using Storm in a commercial sense - and will probably not want to pay 85EUR for a professional license.
I think the first step along the way though is to introduce the idea of dependencies into tasks.
@macrocosm: Please see http://drupal.org/project/usage/Storm - there are currently about 450 reported users. This doesn't report on whether it's being used in a production sense, but I know of several cases where it is, and also have seen many users imply that they are within other issues here.
#19
+1 subscribing
#20
Subscribing. In the meantime, perhaps a coding wizard is able to pull data from the tables and feed it to a google charts:
http://www.designinginteractive.com/code/how-to-build-a-gantt-chart-with...
#21
subscribing
#22
i'm also looking for solution and have found: http://www.jsgantt.com, it's under BSD license, but author is willing to change it if you (we) ask him to: http://www.jsgantt.com/#tLicense, so you could include his code in module.
i have tried using google charts, but after making them half working - i started wanting interactive chart, so that user can click on chart to go to specific task - and change it.
#23
We don't need to include the code in the Storm release, as it can be included as an external library similarly to how the tcpdf library is used in Storm Invoice. The reason that a previous library was debated was because a lot of Storm installations will be used for commercial purposes.
This one could be a good solution though - who volunteers to make a patch? Otherwise it will stay on my 'list of things to do'...
#24
i have some kind of working copy, and will try to make some not-too-much-embarrassing patch during weekend. i will have few questions, about what is best to do, but we can tall about it after i post a patch.
#25
here is the patch against latest dev (2009-Jun-28). all changes are in stormtask.admin.inc file, and gantt chart will appear below task list (task tab of project). here is screenshot:
http://twitpic.com/8og8k
this is only basic functionality. i still need to find out is "Step No." in storm is the same as "Group" in jsgantt. and is "Parent task" in storm is "pDepend" in jsgantt. and to implement that.
there is need for admin interface to choose visible fields, colors, and maybe file caching - jsgantt can use xml file as input, and we could make it right after crating/updating task in project. i need input from other users for this things.
this patch assumes that you have directory "sites/all/libraries/jsgantt" and inside it files jsgantt.js and jsgantt.css from file jsgantt.zip:
http://www.jsgantt.com/zip/
there are few quirks with css witch is generated in javascript, so i'm not sure how to fix them without changing jsgantt.js?
#26
Thanks @homoludens, @all - please review!
I will be testing it out properly myself when I get a minute.
What i'd suggest for now is that we include a setting in StormTask - "Enable Gantt Charts (experimental feature)", so that we can include some of this code in the -dev version and allow people to test it more easily. Also then add in more of the functionality as and when it is completed.
Re dependencies, parent tasks, groups etc. I suspect the parent tasks are better to use to generate groups. Dependencies will need to be added into the tasks - as far as I understand it, the hierarchical nature is simply to group tasks together and there is nothing in Storm at the moment that records which tasks depend on others.
#27
i have added some basic admin controls at admin/storm/tasks. it is possible to enable/disable gantt chart, to choose another directory for jsgantt.js and jsgantt.css - here i'm checking if file really exist, so testing that is recommended.
I have also added options to choose color of charts, enable/disable display of dates and duration in table.
please, try it out and report.
patch is created with:
diff -Naur stormtask stormtaskNew > jsgantt_stormtask.patchand you can apply it from storm directory with
patch -p0 -i jsgantt_stormtask.patchi'm not sure if that is the right way to create patches of multiple files?
#28
OK I've just tested the patch in #27.
First of all - on first install at the moment with latest -dev you will see a php error - which is because I added in some admin settings last night. To make it easier for this, I have got rid of that for now so we can test this more easily.
The things that need working on:
- Task durations - currently anything in hours comes out wrong on the Gantt chart, a zero length duration.
- Dependencies shoot all over the place at the moment - I think also that the parent task should not be used for dependencies but for grouping.
- The width of the chart - goes off the page - is this what you were talking about with the css?
- On clicking on the task, a popup is opened - is it possible to open the link in the same window?
- A minor point - with the admin_settings and menu links, we should refer to "Storm Task" in the singular as that is the precise module name.
Nice start though!
#29
i haven't even though of hours. i guess i don't use them, but will look that up.
on the other hand, i don't even use filed "Duration: " for making charts. mostly because i don't understand why we need both "Date end:" and "Duration:"?
i tried that, and i looks kinda strange, because you see that task like black line and all other are blue - but distinction in storm is not that obvious. it is especially strange if child have it's own children. definitely something i should think about. will try to fix it.
exactly that. i have changed it in mine local jsgantt.js, so it's ok for me. not sure what is the best solution for that.
i have changed line 481:
'<DIV class=scroll id=leftside style="width:' + vLeftWidth + 'px"><TABLE cellSpacing=0 cellPadding=0 border=0><TBODY>' +to:
'<DIV class=scroll id=leftside style="width:' + 400 + 'px"><TABLE cellSpacing=0 cellPadding=0 border=0><TBODY>' +so at least i know how big that table will be. i hope that i/we will find better solution.
yes. almost forgotten that one. most annoying, that was the first change i have done to jsgantt.js line 1445:
// function to open window to display task link
JSGantt.taskLink = function(pRef,pWidth,pHeight)
{
// i hate new windows/tabs - open link in the same tab/window
var OpenWindow=window.location.href=pRef;
// var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
// window.location.href=theUrl;
}
these are problems that i saw, and i hope i will find solution in few days. every input is very much welcomed.
#30
Perhaps the Storm fields could be changed so that duration is simply calculated by [date end] - [date start]. Alternatively, perhaps we could set the task from [date start] and [duration], and use date end as [due date].
It may be a bit difficult if we're making changes to the jsgantt.js file - ideally we'd either be able to override bits in some way or then host the library as part of the package... but then come the license issues... it would have to be released as GNU GPL...
#31
my thoughts also. 2 of those 3 field are enough - third should be calculated from other two. ideally it would be nice that user can use whichever field he/she wants, but mine experience is that i shouldn't let them choose - it is confusing, and they hate it.
i believe it is better to to leave only date fields and to calculate duration. that is more usual approach, and user would have to look at calendar and check for weekends and stuff. and at the end he will even see duration in days, yuhuuu! :)
about jsgantt.js. it is bsd, but if we can not find better way to override some code, we can ask original author to give it to us under gnu glp. he is open about that, so maybe we can get permission. or maybe, even better, he has some ideas how to solve our problems.
i will write to him and ask him both questions. mine preferred solution is to leave it as separate library, so we wouldn't care about that development and fixes.
#32
this is patch against last dev (2009-Jun-29), with changed name of tab to "Storm Task".
#33
Please could a few of the people who were calling for this feature review the patch?
I'd say its pretty close to going in - bar the problems with changing jsgantt.js...
#34
i have received, (btw. very fast response) from jsgantt developer:
me: 1. one problem is that JSGantt.taskLink opens link in new window, and we would
prefer opening in the same window.
Shlomy:
me: 2. width of produced table is to big and goes off the screen
Shlomy:
so we can change the code and include it in our download. or better - make a little fork which works for us and put it on some website (your, mine, some other...).
and then if and when they fix it we will start using official lib. until then we will recommend original release.
for now i will attach mine version of it here.
#35
OK - I'd suggest then we add a folder jsgantt inside of the stormtask folder with:
- The relevant js and css files
- A note explaining that they have been released under the GNU General Public License and giving the modifications that we've made. This might be easier in fact to provide a patch file from the original to the modified in a separate file. This way we can still give credit to the original library code.
The fact remains though - that there are about 15 people who have subscribed to this issue who haven't tested the patch - all i'm looking for is a couple of people to give an opinion on it since it could be a really great piece of functionality if it works properly.
#36
jsGantt library is now in CVS.
An updated version of the patch is attached.
#37
I've committed up to the latest patch for this:
However Gantt chart does not line up with labels - there may be other issues still but I wanted to get the code in other changes make the patches even more useless (they already needed a few edits to apply properly).
#38
it will certainly be easier to fix it once it is in. It is already taking to much time to make it work with every -dev.
and about chart and labels, try adding:
#GanttChartDIV table{margin:0;
}
to jsgantt.css, it sholuld fix the issue.
usualy drupal themes have 1em margin for tables. this should override it only for gantt chart.
#39
Yes - that solves the layout issues and committed.
So other issues to resolve
- Durations / including the more central issue of start/end/duration consistency.
- Dependencies
I'm happy if not all of these are committed before 6.x-1.24 (in fact that may encourage a few more people to comment), but in that case they'd need to be neatened up a bit - for example perhaps all dependencies hidden for now. But that's something I can do pre-release.
#40
I am thinking of ways to use grouping and dependencies. Right now, in mine installation, I'm using Step No. for grouping, and Parent task for dependency. And it feels ok. Problem is that Step No. is simple text field, and not selection box.
Another way would require adding task module Dependency field, and using Parent task for grouping. Basically, same type of field - only different name. But then, I do not understand need for Step No. field.
Is that your idea? Or if you have something other in the mind, you can explain.
Duration is another problem, I have "solved" it with patch in this post: http://drupal.org/node/315455#comment-1784038
Where Duration field is disabled, and I'm thinking to add datetime field instead of simple date for start and end - so duration can be in hours, not only days.
Other ideas?
#41
with regards to the duration and date end..
It would be useful to do away with the duration field and then have a planned date end and a actual date end. Then you could make a simple flag for 'Overdue'. Might be more complicated to incorporate this in the gantt chart, but a simple flag in the task table would be a good start.
#42
I have tested the gantt charts in 6.x-1.x-dev 2009-07-14.
Bug:
Make it pretty solutions
$pName = str_repeat('--', $task->depth) .' '. $pName;div.gantt {width: 100%;
overflow: hidden;
}
Great work on this! This is exactly what I was looking for. I'm fine with looking at tables, but clients like pretty charts!
#43
I've committed your aesthetic suggestions. #2 doesn't display very well - needs work - it cuts off the RHS of the Gantt chart, but it does work better than the existing.
Having trouble getting the script to work with
drupal_add_js(inline) - would you be able to post the changes you made for this?Thanks,
#44
pretty #2 -- I ended up going back to 'overflow: auto;' and then widened my fixed display so the 2nd horizontal scroll for the whole chart doesn't show... this is more specific to my design.
drupal_add_js -- I closed off the div string on line 128 of original version and then added the drupal_add_js around the inside content of the script tag with argument "inline" (code block shown below).
$o_gantt .="<div style='position:relative' class='gantt' id='GanttChartDIV'></div>";
drupal_add_js("
// here's all the html code neccessary to display the chart object
// Future idea would be to allow XML file name to be passed in and chart tasks built from file.
var g = new JSGantt.GanttChart('g',document.getElementById('GanttChartDIV'), 'day');
g.setShowRes(0); // Show/Hide Responsible (0/1)
g.setShowComp(0); // Show/Hide % Complete(0/1)
g.setShowDur('".$dispOpt['ShowDur']."'); // Show/Hide Duration (0/1)
g.setShowStartDate('".$dispOpt['ShowStartDate']."'); // Show/Hide Start Date(0/1)
g.setShowEndDate('".$dispOpt['ShowEndDate']."'); // Show/Hide End Date(0/1)
//g.setFormatArr('day','week','month');
g.setCaptionType('Resource'); // Set to Show Caption (None,Caption,Resource,Duration,Complete)
if( g ) {
// Parameters (pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen)
".$js."
// use the XML file parser
// JSGantt.parseXML('http://localhost/services/sites/default/files/project.xml',g)
g.Draw();
g.DrawDependencies();
}
else
{
alert('not defined');
}
", "inline");
#45
I have added some more features to the chart:
You had a comment by the pColor for task status, perhaps this is along the lines of what you had in mind. The rendered chart is very easy to see overdue tasks, completed tasks, etc. It would be nice to also be able to theme the label on the chart, since once you scroll passed the bars you don't see the colors... i didn't see any easy hook into jsgantt to accomplish this.
All code changes are lines 112-159.
<?php
$now = time();
$one_day = (24 * 60 * 60);
$pColor_default = variable_get('stormtask_jsgantt_color', '00CCFF');
$pColor_overdue = variable_get('stormtask_jsgantt_color_overdue', 'FF0D0D');
foreach($taskstree as $task ) {
$pID = $task->nid;
$pName = $task->title;
$pCaption = $pName;
$pLink = base_path()."node/".$task->nid;
$pStart = date("n/j/Y",$task->datebegin);
$pEnd = date("n/j/Y",$task->dateend);
$pDepend = $task->parents[0];
// $pParent = $task->parents[0];
// theme by task status
$pColor = variable_get('stormtask_jsgantt_color_' . str_replace(' ', '_', $task->taskstatus), $pColor_default);
$pComp = 0;
switch($task->taskstatus) {
case 'completed':
$pComp = 100;
break;
case 'on hold':
$pComp = 50;
break;
case 'in progress':
// percent complete as f($now), end date inclusive
if ($now > $task->datebegin && $task->dateend > $task->datebegin) {
$pComp = ($now - $task->datebegin) / ($task->dateend - $task->datebegin + $one_day);
$pComp = round(100 * $pComp, 2);
}
// highlight overdue tasks
if ($now > $task->dateend) {
$pColor = $pColor_overdue;
}
break;
}
// tasks with depth
if ($task->depth) {
$pName = str_repeat('--', $task->depth) .' '. $pName;
}
$js .= "g.AddTaskItem(new JSGantt.TaskItem(".$pID.",'".$pName."','".$pStart."','".$pEnd."','".$pColor."','".$pLink."',".$pMile.",'".$pRes."',".$pComp.",".$pGroup.",".$pParent.",".$pOpen.",".$pDepend.",'".$pCaption."'));\n";
}
?>
#46
I'm finding it quite hard to apply the changes (and judge between before/after) - any chance of posting diff patches for the last few changes? They look like they might be quite useful.
For some reason also, whenever I use drupal_add_js, the gantt chart does not display for me - it may be something i'm doing wrong, but i'm hesitant to commit this bit until I've figured out why.
Thanks,
#47
i have attached the combined patch for stormtask.admin.inc and stormtask.module - these are off of the latest dev with datestamp = "1248481692" (Sat, 25 Jul 2009 00:28:12 GMT)
Also attached is a screenshot of what the chart looks like with the colors.
For the drupal_add_js: on your test site, is the jsgantt.js library getting loaded before the inline script thats added from drupal_add_js?
#48
found a small bug..
I had a task name that contained a ' and this caused a missing quote error in js. I was able to fix this by changing the name to check_plain($task->title). I did not see any other jsgantt parameter that would need escaped since most are numbers and not user input.
#49
I've added that check_plain - thanks.
In progress with testing the other changes - getting malformed patch if I apply it so going to have a look manually.
#50
@recrit: you have done exact changes that I had on mine todo list. :)
thank you.
I will test it and report if I find problems, but code looks fine.
#51
Magnity - sorry about the patch.. its most likely from when I combine the 2 file patches. I have attached each patch for the files. This is still off of the dev from 1248481692
#52
I've committed those colour changes.
Although I still haven't managed to get the script working using drupal_add_js, so haven't put that in yet. I'll give it another go soon. I'm testing on the demo site, which is a fairly basic install - so i'm a little confused as to why it isn't working...
#53
Hello, I have downloaded and installed version 6.x-1.24, which in the documentation is said to have support for Gantt charts. I assume that this means that as of the August 21st release of version 6.x-1.24 the Gantt charts patch has been included with the release. However, I cannot seem to find how to activate this feature. I have searched through everything and cannot find any reference to Gantt charts except for in the release notes. Is it still necessary to apply this patch in order for it to work? Could we get some documentation on how to use this feature please? And perhaps some screen shots? Thank you.
#54
Activation should be via settings for Storm Task and to see the gantt chart go to the Tasks tab of a Project node.
I would suggest that this should have been a seperate post for the change in category and version but I'll let @Magnity decide.
Thanks
Mark
#55
Fine to ask support questions on the relevant thread - but no need to change the category etc. Not a massive deal though.
#56
thank you .It my loking for.