Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] nie moge wyswietlic obrazka
misty
post
Post #1





Grupa: Zarejestrowani
Postów: 366
Pomógł: 0
Dołączył: 2.01.2007

Ostrzeżenie: (0%)
-----


hej, przeszukalam juz net i powinno dzialac a nie dziala. probuje wyswietlic wygenerowany wykres jako obrazek:

Plik (ktory otwieram w przegladarce) test.php:
  1.  
  2. <?php
  3. //jakies tam rzeczy, a pozniej:
  4. $f = "graph.php";
  5. ?>
  6. <img src="<?php echo $f;?>">
  7.  
  8. <?php
  9.  
  10. ?>


oraz plik graph.php:
  1. require_once ('libs/jpgraph/jpgraph.php');
  2. require_once ('libs/jpgraph/jpgraph_bar.php');
  3. $datay=array(12,26,9,17,31);
  4.  
  5. // Create the graph.
  6. // One minute timeout for the cached image
  7. // INLINE_NO means don't stream it back to the browser.
  8. $graph = new Graph(310,250,'auto');
  9. $graph->SetScale("textlin");
  10. $graph->img->SetMargin(60,30,20,40);
  11. $graph->yaxis->SetTitleMargin(45);
  12. $graph->yaxis->scale->SetGrace(30);
  13. $graph->SetShadow();
  14.  
  15. // Turn the tickmarks
  16. $graph->xaxis->SetTickSide(SIDE_DOWN);
  17. $graph->yaxis->SetTickSide(SIDE_LEFT);
  18.  
  19. // Create a bar pot
  20. $bplot = new BarPlot($datay);
  21.  
  22. // Create targets for the image maps. One for each column
  23. $targ=array("bar_clsmex1.php#1","bar_clsmex1.php#2","bar_clsmex1.php#3","bar_clsmex1.php#4","bar_clsmex1.php#5","bar_clsmex1.php#6");
  24. $alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
  25. $bplot->SetCSIMTargets($targ,$alts);
  26. $bplot->SetFillColor("orange");
  27.  
  28. // Use a shadow on the bar graphs (just use the default settings)
  29. $bplot->SetShadow();
  30. $bplot->value->SetFormat(" $ %2.1f",70);
  31. $bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9);
  32. $bplot->value->SetColor("blue");
  33. $bplot->value->Show();
  34.  
  35. $graph->Add($bplot);
  36.  
  37. $graph->title->Set("Image maps barex1");
  38. $graph->xaxis->title->Set("X-title");
  39. $graph->yaxis->title->Set("Y-title");
  40.  
  41. $graph->title->SetFont(FF_FONT1,FS_BOLD);
  42. $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
  43. $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
  44.  
  45. // Send back the HTML page which will call this script again
  46. // to retrieve the image.
  47. $graph->StrokeCSIM();
  48.  
  49. return;



jak wejde w localhost/graph.php to widze wykres jako obrazek. jak wchodze poprzez localhost/test.php to widze taki maly kwadracik gdzie powinien byc obrazek a go nie mam.
nie rozumiem czemu to nie dziala? na prawde przejrzalam juz google i wszedzie pisza ze to jest sposob..
bede wdzieczna za wszystkie wskazowki,

pzdr,
misty
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 00:42