473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Has Anyone Coded Any Gantt Charts?

Hi there

Just before I sit down and re-invent the wheel, I was wondering if anyone
here has coded any Gantt charts (preferably 'week' style as opposed to
'month' style) and might have a class to share?

I've checked out phpclasses.org, and nothing quite suits my purposes. I
can hack one or two to turn it into what I need, but hey, might as well
check here first!

Thanks.

Apr 20 '06 #1
18 4041
Please have a closer look at
http://www.google.com/search?q=php+gantt

Apr 20 '06 #2
"milahu" <mi****@googlemail.com> wrote in news:1145567121.868018.244970
@g10g2000cwb.googlegroups.com:
Please have a closer look at
http://www.google.com/search?q=php+gantt


yes, obviously i have, there is nothing there that suits me.

essentially im looking for a gantt chart that does NOT get rendered as an
image (gif/png/jpg) and is more along the lines of HTML output.
Apr 20 '06 #3
On Thu, 20 Apr 2006 15:21:48 -0500, Good Man wrote:
Hi there

Just before I sit down and re-invent the wheel, I was wondering if anyone
here has coded any Gantt charts (preferably 'week' style as opposed to
'month' style) and might have a class to share?

I've checked out phpclasses.org, and nothing quite suits my purposes. I
can hack one or two to turn it into what I need, but hey, might as well
check here first!

Thanks.


Try jpgraph (http://www.aditus.nu/jpgraph/index.php)

--
http://www.mgogala.com

Apr 21 '06 #4
Mladen Gogala <go****@sbcglobal.net> wrote in
news:pa****************************@sbcglobal.net:
On Thu, 20 Apr 2006 15:21:48 -0500, Good Man wrote:
Hi there

Just before I sit down and re-invent the wheel, I was wondering if
anyone here has coded any Gantt charts (preferably 'week' style as
opposed to 'month' style) and might have a class to share?

I've checked out phpclasses.org, and nothing quite suits my purposes.
I can hack one or two to turn it into what I need, but hey, might as
well check here first!

Thanks.


Try jpgraph (http://www.aditus.nu/jpgraph/index.php)


yeah it's pretty sweet, but ultimately i'd be looking for html output, as i
will need to make links out of events, etc. it looks like i might have to
alter a class that produces images and customize it.

Apr 21 '06 #5
| > Try jpgraph (http://www.aditus.nu/jpgraph/index.php)
| >
|
| yeah it's pretty sweet, but ultimately i'd be looking for html output, as
i
| will need to make links out of events, etc. it looks like i might have to
| alter a class that produces images and customize it.

that's what i wanted to hear! knowing exactly why html over an image is
important. have you thought of combining two wheels rather than inventing
one? bad play on words...what i mean is to utilize the image and only use
html where it's absolutely needed? consider how many browsers there are to
support, how differently they render even simple html...then, how difficult
it will be to manage it all with html?

it can be done...but have you thought of perhaps simply altering the php
classes that produce image based charts and tie in html to those key
functions you need...say, using image mapping and javascript? creating the
mapping would be super easy since you typically only have to deal with
rectangular (regular) shapes...no complicated definitions of areas.

an approach like that may have you up and running in a couple of days rather
than a couple of weeks.

just a thought.

best of luck.

(no haiku intended ;^)
Apr 21 '06 #6
Rik
robert wrote:
yeah it's pretty sweet, but ultimately i'd be looking for html
output, as i will need to make links out of events, etc. it looks
like i might have to alter a class that produces images and
customize it.

consider how
many browsers there are to support, how differently they render even
simple html...then, how difficult it will be to manage it all with
html?

it can be done...but have you thought of perhaps simply altering the
php classes that produce image based charts and tie in html to those
key functions you need...say, using image mapping and javascript?

Euhm.... saying HTML is rendered very differently on browsers and then
advising javascript? That's even more of a gamble in different browsers.

I say: if it's possible in HTML, go for it. Semantically logical
information, and keeping images / client-side script to a minimum increases
accessability (?... pff english..) and reduces bandwith and probably server
load.

Grtz
--
Rik
Apr 21 '06 #7

"Rik" <lu************@hotmail.com> wrote in message
news:e2**********@netlx020.civ.utwente.nl...
| robert wrote:
| >> yeah it's pretty sweet, but ultimately i'd be looking for html
| >> output, as i will need to make links out of events, etc. it looks
| >> like i might have to alter a class that produces images and
| >> customize it.
| > consider how
| > many browsers there are to support, how differently they render even
| > simple html...then, how difficult it will be to manage it all with
| > html?
| >
| > it can be done...but have you thought of perhaps simply altering the
| > php classes that produce image based charts and tie in html to those
| > key functions you need...say, using image mapping and javascript?
|
|
| Euhm.... saying HTML is rendered very differently on browsers and then
| advising javascript? That's even more of a gamble in different browsers.

euhm's aside. the js is most likely going to handle a non-complex function
like an onclick event. now that's vs. generating an entire html based gannt
chart with all of it's elements and pieces...while maintaining it's visual
aspects, then has to still deliver it's functionality...and that, probably a
js handled onclick event. now, would you like to add more sarcasm?

| I say: if it's possible in HTML, go for it. Semantically logical
| information, and keeping images / client-side script to a minimum
increases
| accessability (?... pff english..) and reduces bandwith and probably
server
| load.

sure it's possible...probably not the best route to go though. you do
realize your arg. for not using client-side code here is that it reduces
bandwidth and server load? let me bring it home...if the client is doing
less of the processing...there must be something else doing more of the
processing...i think that would be the server. ;^) as for bandwidth, if the
server is picking up the load (since you don't want the client to), then any
extra functionality beyond initial delivery of content will mean another
trip to the server to get it...hmmm...let's forget "semantically" and just
stick to the "logical" arguments...perhaps then, you'll grasp it and realize
your above statement is less than well thought out.

now if you can think outside of the "i'm smarter than you" mentality it
seems you prefer, you'd also know that image mapping doesn't have to be
client-side and the server is fully capable of handling as much of this as
you want it too. if you're worried that js won't work in a browser...just
have the server process it. either way, you can't say "have the client
process this to reduce server load" and in the same breath say "client side
processing is a bad idea". what i'm saying is that you can choose a simple
solution without having to completely start from scratch...and it's flexible
enough to work in more than one fashion.

aside from your patronization attempts, why not make yourself useful and
address the op...because surely out of all your responses/criticisms, you
must have more genius to display than "go for it".
Apr 21 '06 #8
NC
Good Man wrote:

Just before I sit down and re-invent the wheel, I was wondering if
anyone here has coded any Gantt charts (preferably 'week' style as
opposed to 'month' style) and might have a class to share? .... ultimately i'd be looking for html output, as i will need to make
links out of events, etc.


It should be fairly simple... In PHP 4, you could write:

Class GanttChart {
var $activities;
var $start;
var $end;
var $unit;
function GanttChart ($start = 0, $end = 0, $unit = 'weeks') {
$this->start = $start;
$this->end = $end;
$this->unit = $unit;
$this->activities = array();
}
function AddActivity ($description, $start, $end, $color) {
$this->activities[] = array('start' => $start, 'end' => $end,
'description' => $description, 'color' => $color);
$this->start = min($this->start, $start);
$this->end = max($this->end, $end);
}
function Render ($unit_width = 50) {
$duration = $this->end - $this->start;
echo "<table border=0 cellspacing=0 cellpadding=2>\r\n";
echo "<tr><th colspan=$duration>", strtoupper($this->unit),
"\r\n<tr>\r\n";
for ($i = $this->start; $i <= $this->end; $i++) {
echo "<th width=$unit_width>$i";
}
foreach ($this->activities as $activity) {
$start = $activity['start'];
$end = $activity['end'];
$description = $activity['description'];
$color = $activity['color'];
$before = $start;
$duration = $end - $start + 1;
$after = $this->end - $end;
echo "<tr>\r\n";
if ($before > 0) {
echo "<td colspan=$before>&nbsp;\r\n";
}
echo "<td colspan=$duration align=center
bgcolor=$color>$description\r\n";
if ($after > 0) {
echo "<td colspan=$after>&nbsp;\r\n";
}
}
echo "</table>\r\n";
}
}

Usage example:

$G = new GanttChart();
$G->AddActivity('First Activity', 0, 5, 'red');
$G->AddActivity('Second Activity', 6, 15, 'yellow');
$G->AddActivity('Third Activity', 4, 11, '#40f040');
$G->Render();

HTML has been kept to a minimum for clarity; you can beautify it all
you want...

Cheers,
NC

Apr 21 '06 #9
"NC" <nc@iname.com> wrote in news:1145632126.048403.188970
@j33g2000cwa.googlegroups.com:
It should be fairly simple... In PHP 4, you could write: <snip> HTML has been kept to a minimum for clarity; you can beautify it all
you want...


Holy smokes! This is perfect for setting me on my way. Many, many thanks.
Apr 21 '06 #10
"robert" <ab@nospam.com> wrote in news:Vg***********@fe05.lga:

"Rik" <lu************@hotmail.com> wrote in message | Euhm.... saying HTML is rendered very differently on browsers and
| then advising javascript? That's even more of a gamble in different
| browsers.

euhm's aside. the js is most likely going to handle a non-complex
function like an onclick event. now that's vs. generating an entire
html based gannt chart with all of it's elements and pieces...while
maintaining it's visual aspects, then has to still deliver it's
functionality...and that, probably a js handled onclick event. now,
would you like to add more sarcasm?


just to add a couple thoughts to the thread (now-now fellas, play nice).

It's true that going with the various working (and in the case of
JpGraph, fabulous) image solutions to my Gantt quest would probably get
things going quickly. However, HTML just gives me much more flexibility
design-wise (CSS styles, for example) and functionality wise (AJAX calls
to fetch more information about a task when moused over, etc).

The poster 'NC' has set me on my way.

Thanks for the thoughts/thread/help.

Apr 21 '06 #11
"NC" <nc@iname.com> wrote in news:1145632126.048403.188970
@j33g2000cwa.googlegroups.com:
Good Man wrote:
It should be fairly simple... In PHP 4, you could write:


I'm also going to take this opportunity to finally delve into OO
programming.

Do you think I should change this to a PHP 5-style class?
Apr 21 '06 #12
NC
Good Man wrote:

Do you think I should change this to a PHP 5-style class?


It's entirely up to you. Right now, the only things you need to do to
make my GanttChart class PHP5-compliant are:

1. Rename the GanttChart() method into __construct(), and
2. Replace 'var' declarations with 'public' declarations.

Cheers,
NC

Apr 21 '06 #13
"NC" <nc@iname.com> wrote in news:1145634476.723222.159000
@t31g2000cwb.googlegroups.com:
It's entirely up to you. Right now, the only things you need to do to
make my GanttChart class PHP5-compliant are:

1. Rename the GanttChart() method into __construct(), and
2. Replace 'var' declarations with 'public' declarations.


Again, many thanks.

Apr 21 '06 #14
Rik
robert wrote:
yeah it's pretty sweet, but ultimately i'd be looking for html
output, as i will need to make links out of events, etc. it looks
like i might have to alter a class that produces images and
customize it.
consider how
many browsers there are to support, how differently they render even
simple html...then, how difficult it will be to manage it all with
html?

it can be done...but have you thought of perhaps simply altering the
php classes that produce image based charts and tie in html to those
key functions you need...say, using image mapping and javascript?
Euhm.... saying HTML is rendered very differently on browsers and
then advising javascript? That's even more of a gamble in different
browsers.


euhm's aside. the js is most likely going to handle a non-complex
function like an onclick event. now that's vs. generating an entire
html based gannt chart with all of it's elements and pieces...while
maintaining it's visual aspects, then has to still deliver it's
functionality...and that, probably a js handled onclick event. now,
would you like to add more sarcasm?


Server delivers HTML -> you''re absolutely sure what HTML arrives at the
client

Page relies heavily on js -> let's hope it works, and scripting is even
enabled...
I say: if it's possible in HTML, go for it. Semantically logical
information, and keeping images / client-side script to a minimum
increases accessability (?... pff english..) and reduces bandwith
and probably server load.


sure it's possible...probably not the best route to go though. you do
realize your arg. for not using client-side code here is that it
reduces bandwidth and server load?


Main argument here was accessability, not server load.
let me bring it home...if the
client is doing less of the processing...there must be something else
doing more of the processing...i think that would be the server. ;^)
as for bandwidth, if the server is picking up the load (since you
don't want the client to), then any extra functionality beyond
initial delivery of content will mean another trip to the server to
get it...hmmm...let's forget "semantically" and just stick to the
"logical" arguments...perhaps then, you'll grasp it and realize your
above statement is less than well thought out.
My statement was delivered somewhat poorly in this case, because I wanted to
stress a few general preferences in webpages:
1. If you want a functional element on you're webpage, and it doesn't have
to be an image, don't make it an image.
2. If you want dynamical functionality that can either be done server side
or client side, I'd prefer serverside: you're sure about the outcome, and
you'll have to do very little in browser-specific coding.

That's the point I was trying to make: it increases accessability
(cross-browser, even browsers for the visually impaired, plain-text browsers
etc.), and reliability: you're absolutely sure what HTML code is sent to the
client, which is semantically sound.

Yes, it's clear I have no fondness for js, every time I'm forced to use it I
feel a little bit sad.....
now if you can think outside of the "i'm smarter than you" mentality
it seems you prefer,
Pardon? Maybe it's because English isn't my native language, but that wasn't
the way I intended to come across. I merely wanted to express my thorough
preference of complete HTML instead of js.
you'd also know that image mapping doesn't have
to be client-side and the server is fully capable of handling as much
of this as you want it too.
I'm convinced that functionality shouldn't be in/behind/whatever images. You
can make it look like it by css, but everything on a website should work
with images disabled. Css is a wonderful method to make give it a nice
layout, in combination with logical HTML layout it makes a great page.
if you're worried that js won't work in a
browser...just have the server process it. either way, you can't say
"have the client process this to reduce server load" and in the same
breath say "client side processing is a bad idea".
Which reading back could be interpreted as such. Creating dynamical images
on server (unless they're cached in some way) is also a big server load.
"have the client process this to reduce server load" is something I'd rarely
say: For the client to process things it would have to get the information
from the server anyway, and I'd be curious what heavy load processing you'd
intended js to do. A few simple calculations while sending the information
wouldn't increase serverload that much, and I'm convinced complex processes
have no place in javascript.
what i'm saying is
that you can choose a simple solution without having to completely
start from scratch...and it's flexible enough to work in more than
one fashion.
Commercially correct, technically I have my doubts.
aside from your patronization attempts, why not make yourself useful
and address the op...because surely out of all your
responses/criticisms, you must have more genius to display than "go
for it".


Once again, I didn't mean to sound patronizing, I'm sorry. I have never
attempted to create Gantt-charts myself, so I'm not that much help in this
case. I applaud the op for wanting it in HTML though. And as far as I gather
he has a perfect solution now, with server sided code and plain HTML.

Still, I believe the statement:"Use javascipt, because HTML rendering in
browsers is unreliable." is utterly wrong, even backwards. I'd say:"Use
HTML, because javascript processing in browsers is unreliable."

In this particular case, could you tell me how the solution the op was
looking for and the answer he got for outputting HTML would be better, and
more reliable in javascript?

Grtz,
--
Rik
Apr 22 '06 #15
Rik
NC wrote:
Just before I sit down and re-invent the wheel, I was wondering if
anyone here has coded any Gantt charts (preferably 'week' style as
opposed to 'month' style) and might have a class to share? ...
ultimately i'd be looking for html output, as i will need to make
links out of events, etc.


It should be fairly simple... In PHP 4, you could write:


<SNIP>
HTML has been kept to a minimum for clarity; you can beautify it all
you want...


Such as ending cells (</td>) and quoting table-cell properties? :-)

Aside from that nice code

Grtz,
--
Rik
Apr 22 '06 #16
NC
Rik wrote:
NC wrote:
HTML has been kept to a minimum for clarity; you can beautify
it all you want...


Such as ending cells (</td>) and quoting table-cell properties? :-)


</td> is optional and has always been optional:

http://www.w3.org/TR/1999/REC-html40....html#h-11.2.6

Quoting the values of attributes is not required (although
recommended), if the values the values contain only Latin letters,
digits, hyphens (ASCII decimal 45), periods (ASCII decimal 46),
underscores (ASCII decimal 95), and colons (ASCII decimal 58):

http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2

Cheers,
NC

Apr 22 '06 #17
Rik
NC wrote:
Rik wrote:
NC wrote:
HTML has been kept to a minimum for clarity; you can beautify
it all you want...


Such as ending cells (</td>) and quoting table-cell properties? :-)


</td> is optional and has always been optional:

http://www.w3.org/TR/1999/REC-html40....html#h-11.2.6

Quoting the values of attributes is not required (although
recommended), if the values the values contain only Latin letters,
digits, hyphens (ASCII decimal 45), periods (ASCII decimal 46),
underscores (ASCII decimal 95), and colons (ASCII decimal 58):

http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2

Hmmmz, not making a good impression in this thread. Only made XHTML
lately...
Let's say it's indeed "beautifying" :-)

Grtz,
--
Rik Wasmus
Apr 22 '06 #18
I've just started an MS Project publisher application. Have not spnt
much time on it - but its here if you want a look.

http://www.programming.pwp.blueyonder.co.uk/index.htm

Regards,
Bob
On Fri, 21 Apr 2006 00:41:58 GMT, Mladen Gogala <go****@sbcglobal.net>
wrote:
On Thu, 20 Apr 2006 15:21:48 -0500, Good Man wrote:
Hi there

Just before I sit down and re-invent the wheel, I was wondering if anyone
here has coded any Gantt charts (preferably 'week' style as opposed to
'month' style) and might have a class to share?

I've checked out phpclasses.org, and nothing quite suits my purposes. I
can hack one or two to turn it into what I need, but hey, might as well
check here first!

Thanks.


Try jpgraph (http://www.aditus.nu/jpgraph/index.php)

Apr 25 '06 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andreas Kaiser | last post by:
Hi, is there a module to create gantt charts? Thanks Andreas
2
by: Chris Williams | last post by:
Hi all: I need to make gantt charts but I don`t know where to begin. Is it possible to make them in C/C++. Where do I begin to investigate? Thanks in advance for any hint or help.
14
by: santosh | last post by:
Hello all I want to know whether there is any greedy approach for job sequencing with variable job completion times.. if there is no greedy approach how to prove it...
2
by: Dan Nash | last post by:
Hi peeps I need to use a Gantt charting display in my project. Unfortunately, the client has no spare cash for such frivolities as buying controls, so I'm going to have to write something. So I...
18
by: DFS | last post by:
I posted this question yesterday, and nothing but silence. I looked through cdma in Google, and it seems whenever someone posts questions about scatter charts, they get ignored. So, hopefully,...
0
by: Gilberto Avila | last post by:
I'm currently developing a web application with ASP .NET 1.1. I'm using the bundled Crystal Reports in Visual Studio 2003 to create reports for this application. The system specification requires...
5
by: Kuna | last post by:
Hi All, I am trying to create a gantt chart in php by getting data from database. I am using WindowsXp OS and having php-4 and my-sql DB. I have installed the JPGRAPH package to my system and...
9
menayah
by: menayah | last post by:
Dear all, How to make a gantt chart from datagrid (datatable) in VB .net web forms ? What are the softwear the I can use for that? Thanks...
3
by: Solaron | last post by:
Hi Guys, my first post. I've been doing alot of "googling" for a way to make Gantt charts as an Access report. I am aware of what MS Project and Visio do and also aware of other programs out...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.