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
 
Start new topic
Odpowiedzi
misty
post
Post #2





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

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


to mam:

  1. <map name="__mapname98084__" id="__mapname98084__" >
  2. <area shape="poly" coords="74, 210, 74, 165, 92, 165, 92, 210" href="bar_clsmex1.php#1" title="val=12" alt="val=12" />
  3. <area shape="poly" coords="118, 210, 118, 113, 136, 113, 136, 210" href="bar_clsmex1.php#2" title="val=26" alt="val=26" />
  4. <area shape="poly" coords="162, 210, 162, 176, 180, 176, 180, 210" href="bar_clsmex1.php#3" title="val=9" alt="val=9" />
  5. <area shape="poly" coords="206, 210, 206, 146, 224, 146, 224, 210" href="bar_clsmex1.php#4" title="val=17" alt="val=17" />
  6. <area shape="poly" coords="250, 210, 250, 94, 268, 94, 268, 210" href="bar_clsmex1.php#5" title="val=31" alt="val=31" />
  7. </map><img src="graph.php?_jpg_csimd=1" ismap="ismap" usemap="#__mapname98084__" height="250" alt="" />
  8.  


a moze ja cos musze ustawic samym php? bo jak dla mnie to wyglada na to ze on tego nie traktuje jako skryptu do wykonania
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: 4.10.2025 - 11:44