Drawing Graphs with PHP

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

    Drawing Graphs with PHP

    Hi, I'm looking for a package useful to draw graphs (like those listed at
    the page http://www.graphviz.org/, not general charts). Can you provide me
    with some indication please? Many thanks!
    Best,
    Nic


  • Prince of Code

    #2
    Re: Drawing Graphs with PHP

    hi,
    The only option with which we draw graph in PHP is GD package. You can
    device your algorithm to draw graphs. In fact graph are great area in
    mathematics and computing.

    Also pls check out in www.phpclasses.org if u hav any classes for the
    purpose.

    princeofcode

    Comment

    • NC

      #3
      Re: Drawing Graphs with PHP

      Nico wrote:[color=blue]
      > I'm looking for a package useful to draw graphs (like those
      > listed at the page http://www.graphviz.org/, not general charts).[/color]

      How about Graphviz itself? The Graphviz resource page:



      mentions several PHP applications that use Graphviz, including a PEAR
      class. Take a look at those; perhaps, one of them will help you figure
      out how to make Graphviz work with PHP...

      Cheers,
      NC

      Comment

      • Good Man

        #4
        Re: Drawing Graphs with PHP

        "Nico" <nospam@nospam. nospam> wrote in
        news:445b1429$0 $29733$4fafbaef @reader2.news.t in.it:
        [color=blue]
        > Hi, I'm looking for a package useful to draw graphs (like those listed
        > at the page http://www.graphviz.org/, not general charts). Can you
        > provide me with some indication please? Many thanks!
        > Best,
        > Nic[/color]



        Comment

        • NC

          #5
          Re: Drawing Graphs with PHP

          Good Man wrote:[color=blue]
          > "Nico" <nospam@nospam. nospam> wrote in
          > news:445b1429$0 $29733$4fafbaef @reader2.news.t in.it:
          >[color=green]
          > > Hi, I'm looking for a package useful to draw graphs (like those listed
          > > at the page http://www.graphviz.org/, not general charts).[/color]
          >
          > http://www.aditus.nu/jpgraph/[/color]

          As much as I like JpGraph, it's probably not going to work too well;
          the OP seems to want to draw tree charts, relationship diagrams, and
          the like... For those, JpGraph will be a very minor improvement over
          starting from scratch...

          Cheers,
          NC

          Comment

          • Colin McKinnon

            #6
            Re: Drawing Graphs with PHP

            NC wrote:
            [color=blue]
            > Nico wrote:[color=green]
            >> I'm looking for a package useful to draw graphs (like those
            >> listed at the page http://www.graphviz.org/, not general charts).[/color]
            >
            > How about Graphviz itself? The Graphviz resource page:
            >
            > http://www.graphviz.org/Resources.php[/color]

            That's what I do - I generate dot files using PHP, and output them to a
            temporary file (using a caching mechanism). The use the header() function
            to tell the browser I'm sending it a Jpeg image.

            Looks something like this:
            <?php

            ....

            $cache_name=get _cache_name();
            if (not_cached($ca che_name)) {
            $dotfile=gen_do t_file();
            $tmpfile=write_ tmp_file($dotfi le);
            // this was a quick hack so I dumped the dot file into
            // a temp file - but with a bit of effort you could
            // send it to stdin instead
            $run="/usr/bin/dot -Tjpg -o $cache_name $tmpfile";
            $output=`$run`;
            }
            header("Content-type: image/jpeg");
            readfile($cache _name);
            ?>

            HTH

            C.

            Comment

            • Nico

              #7
              Re: Drawing Graphs with PHP

              Many thanks!
              I'll try graphviz.
              Nic

              "NC" <nc@iname.com > ha scritto nel messaggio
              news:1146859035 .236651.85550@i 40g2000cwc.goog legroups.com...[color=blue]
              > Good Man wrote:[color=green]
              >> "Nico" <nospam@nospam. nospam> wrote in
              >> news:445b1429$0 $29733$4fafbaef @reader2.news.t in.it:
              >>[color=darkred]
              >> > Hi, I'm looking for a package useful to draw graphs (like those listed
              >> > at the page http://www.graphviz.org/, not general charts).[/color]
              >>
              >> http://www.aditus.nu/jpgraph/[/color]
              >
              > As much as I like JpGraph, it's probably not going to work too well;
              > the OP seems to want to draw tree charts, relationship diagrams, and
              > the like... For those, JpGraph will be a very minor improvement over
              > starting from scratch...
              >
              > Cheers,
              > NC
              >[/color]


              Comment

              Working...