Has Anyone Coded Any Gantt Charts?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Good Man

    #1

    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.

  • milahu

    #2
    Re: Has Anyone Coded Any Gantt Charts?

    Please have a closer look at


    Comment

    • Good Man

      #3
      Re: Has Anyone Coded Any Gantt Charts?

      "milahu" <milahu@googlem ail.com> wrote in news:1145567121 .868018.244970
      @g10g2000cwb.go oglegroups.com:
      [color=blue]
      > Please have a closer look at
      > http://www.google.com/search?q=php+gantt[/color]

      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.

      Comment

      • Mladen Gogala

        #4
        Re: Has Anyone Coded Any Gantt Charts?

        On Thu, 20 Apr 2006 15:21:48 -0500, Good Man wrote:
        [color=blue]
        > 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.[/color]

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

        --
        大红鹰娱乐平台采用顶级加密技术,确保用户数据与交易的安全无虞,让玩家能够放心畅玩。


        Comment

        • Good Man

          #5
          Re: Has Anyone Coded Any Gantt Charts?

          Mladen Gogala <gogala@sbcglob al.net> wrote in
          news:pan.2006.0 4.21.00.41.58.8 97939@sbcglobal .net:
          [color=blue]
          > On Thu, 20 Apr 2006 15:21:48 -0500, Good Man wrote:
          >[color=green]
          >> 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.[/color]
          >
          > Try jpgraph (http://www.aditus.nu/jpgraph/index.php)
          >[/color]

          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.

          Comment

          • robert

            #6
            Re: Has Anyone Coded Any Gantt Charts?

            | > 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 ;^)


            Comment

            • Rik

              #7
              Re: Has Anyone Coded Any Gantt Charts?

              robert wrote:[color=blue][color=green]
              >> 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.[/color]
              > 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?[/color]


              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


              Comment

              • robert

                #8
                Re: Has Anyone Coded Any Gantt Charts?


                "Rik" <luiheidsgoeroe @hotmail.com> wrote in message
                news:e2a6o0$he1 $1@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...prob ably 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...th ere 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 "semantical ly" and just
                stick to the "logical" arguments...per haps 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".


                Comment

                • NC

                  #9
                  Re: Has Anyone Coded Any Gantt Charts?

                  Good Man wrote:[color=blue]
                  >
                  > 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?[/color]
                  ....[color=blue]
                  > ultimately i'd be looking for html output, as i will need to make
                  > links out of events, etc.[/color]

                  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=$durati on>", strtoupper($thi s->unit),
                  "\r\n<tr>\r \n";
                  for ($i = $this->start; $i <= $this->end; $i++) {
                  echo "<th width=$unit_wid th>$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=$durati on 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('F irst Activity', 0, 5, 'red');
                  $G->AddActivity('S econd Activity', 6, 15, 'yellow');
                  $G->AddActivity('T hird Activity', 4, 11, '#40f040');
                  $G->Render();

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

                  Cheers,
                  NC

                  Comment

                  • Good Man

                    #10
                    Re: Has Anyone Coded Any Gantt Charts?

                    "NC" <nc@iname.com > wrote in news:1145632126 .048403.188970
                    @j33g2000cwa.go oglegroups.com:
                    [color=blue]
                    > It should be fairly simple... In PHP 4, you could write:[/color]
                    <snip>[color=blue]
                    > HTML has been kept to a minimum for clarity; you can beautify it all
                    > you want...[/color]

                    Holy smokes! This is perfect for setting me on my way. Many, many thanks.

                    Comment

                    • Good Man

                      #11
                      Re: Has Anyone Coded Any Gantt Charts?

                      "robert" <ab@nospam.co m> wrote in news:Vg52g.1$nJ 1.0@fe05.lga:
                      [color=blue]
                      >
                      > "Rik" <luiheidsgoeroe @hotmail.com> wrote in message[/color]
                      [color=blue]
                      >| 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?[/color]

                      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.

                      Comment

                      • Good Man

                        #12
                        Re: Has Anyone Coded Any Gantt Charts?

                        "NC" <nc@iname.com > wrote in news:1145632126 .048403.188970
                        @j33g2000cwa.go oglegroups.com:
                        [color=blue]
                        > Good Man wrote:[color=green]
                        >> It should be fairly simple... In PHP 4, you could write:[/color][/color]

                        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?

                        Comment

                        • NC

                          #13
                          Re: Has Anyone Coded Any Gantt Charts?

                          Good Man wrote:[color=blue]
                          >
                          > Do you think I should change this to a PHP 5-style class?[/color]

                          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

                          Comment

                          • Good Man

                            #14
                            Re: Has Anyone Coded Any Gantt Charts?

                            "NC" <nc@iname.com > wrote in news:1145634476 .723222.159000
                            @t31g2000cwb.go oglegroups.com:
                            [color=blue]
                            > 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.[/color]

                            Again, many thanks.

                            Comment

                            • Rik

                              #15
                              Re: Has Anyone Coded Any Gantt Charts?

                              robert wrote:[color=blue][color=green][color=darkred]
                              >>>> 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?[/color]
                              >>
                              >> Euhm.... saying HTML is rendered very differently on browsers and
                              >> then advising javascript? That's even more of a gamble in different
                              >> browsers.[/color]
                              >
                              > 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?[/color]

                              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...
                              [color=blue][color=green]
                              >> 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.[/color]
                              >
                              > sure it's possible...prob ably 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?[/color]

                              Main argument here was accessability, not server load.
                              [color=blue]
                              > let me bring it home...if the
                              > client is doing less of the processing...th ere 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 "semantical ly" and just stick to the
                              > "logical" arguments...per haps then, you'll grasp it and realize your
                              > above statement is less than well thought out.[/color]

                              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.....
                              [color=blue]
                              > now if you can think outside of the "i'm smarter than you" mentality
                              > it seems you prefer,[/color]

                              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.
                              [color=blue]
                              > 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.[/color]

                              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.
                              [color=blue]
                              > 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".[/color]

                              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.
                              [color=blue]
                              > 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.[/color]

                              Commercially correct, technically I have my doubts.
                              [color=blue]
                              > 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".[/color]

                              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


                              Comment

                              Working...