jpgraph problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paeh
    New Member
    • Dec 2007
    • 11

    #1

    jpgraph problem

    what's wrong for this php code. when I run did not display anything in browser..

    this is code:

    <?php
    include ("C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/jpgraph-2.3/src/jpgraph.php");
    include ("C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/jpgraph-2.3/src/jpgraph_bar.php ");

    $db = mysql_connect(" localhost", "root","") or die(mysql_error ());

    mysql_select_db ("test",$db) or die(mysql_error ());

    $sql = mysql_query("SE LECT * FROM students") die(mysql_error ());

    while($row = mysql_fetch_arr ay($sql))
    {
    $data[] = $row[1];
    $leg[] = $row[0];
    }

    $graph = new Graph(250,150," auto");
    $graph->SetScale("text int");
    $graph->img->SetMargin(50,3 0,50,50);
    $graph->AdjBackgroundI mage(0.4,0.7,-1); //setting BG type
    $graph->SetBackgroundI mage("linux_pez .png",BGIMG_FIL LFRAME); //adding image
    $graph->SetShadow();

    $graph->xaxis->SetTickLabels( $leg);

    $bplot = new BarPlot($data);
    $bplot->SetFillColor(" lightgreen"); // Fill color
    $bplot->value->Show();
    $bplot->value->SetFont(FF_ARI AL,FS_BOLD);
    $bplot->value->SetAngle(45) ;
    $bplot->value->SetColor("blac k","navy");

    $graph->Add($bplot);
    $graph->Stroke();
    ?>

    any expert please help me..
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    I'm not an expert with jpgraph, but i'll try.

    Have you tried using a relative url for the inclusion?

    Comment

    • paeh
      New Member
      • Dec 2007
      • 11

      #3
      thanks guru..

      can you give me example to do that?

      Comment

      Working...