Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne][PHP]pchar Limits Graph problem
michal_1983
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 12.03.2010

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


witam,

mam problem z wygenerowaniem poprawnego Limits Graph'u
chodzi o to ze generuje 2 wykresy naraz najpierw liniowy pozniej Limits Graph
i tu pojawia sie problem poniewaz dolne wartosci w limits graphie troszke szwankuja

wszystko jest ok ale jak wyswietlam tylko jeden typ wykresu
jak probuje wyswietlic oba na raz to jest zle (IMG:style_emoticons/default/sad.gif)
nie mam juz pojecia gdzie jest blad

zamieszczam kod php do wgladu:

  1. <?
  2. // Standard inclusions
  3. include("pChart/pData.class");
  4. include("pChart/pChart.class");
  5.  
  6. // Dataset definition
  7. $DataSet = new pData;
  8.  
  9. $DataSet->AddPoint(array(6,9,8,8,7,9,8,6,7,3),"Serie1");
  10. $DataSet->AddPoint(array(2,1,3,2,1,3,2,4,2,1),"Serie2");
  11. $DataSet->AddPoint(array(1,4,2,9,8,5,4,6,3,2),"Serie3");
  12.  
  13. $DataSet->SetSerieName("Up","Serie1");
  14. $DataSet->SetSerieName("Down","Serie2");
  15. $DataSet->SetSerieName("X","Serie3");
  16.  
  17. // Initialise the graph
  18. $Test = new pChart(700,277);
  19.  
  20. $DataSet->AddSerie("Serie3");
  21.  
  22. $DataSet->SetYAxisName("Serie X");
  23.  
  24. $Test->setFontProperties("Fonts/tahoma.ttf",8);
  25. $Test->setGraphArea(50,30,585,200);
  26. $Test->drawFilledRoundedRectangle(7,7,693,272,5,240,240,240);
  27. $Test->drawRoundedRectangle(5,5,695,275,5,230,230,230);
  28. $Test->drawGraphArea(255,255,255,TRUE);
  29.  
  30. $Test->drawRightScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,45,0);
  31. $Test->drawGrid(4,TRUE,230,230,230,50);
  32.  
  33. $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
  34. $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
  35.  
  36. // Clear the scale
  37. $Test->clearScale();
  38.  
  39. // Draw the 2nd graph
  40. $DataSet->RemoveSerie("Serie3");
  41.  
  42. $DataSet->AddSerie("Serie1");
  43. $DataSet->AddSerie("Serie2");
  44. $DataSet->SetYAxisName("Serie Up, Down");
  45.  
  46. $Test->setFontProperties("Fonts/tahoma.ttf",8);
  47.  
  48. $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,45,2);
  49.  
  50. // Draw the limit graph
  51. $Test->drawLimitsGraph($DataSet->GetData(),$DataSet->GetDataDescription(),180,180,180);
  52.  
  53. $Test->setFontProperties("Fonts/tahoma.ttf",8);
  54. $Test->writeValues($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie1");
  55. $Test->writeValues($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie2");
  56.  
  57. // Finish the graph
  58. $Test->setFontProperties("Fonts/tahoma.ttf",8);
  59. $Test->drawLegend(625,30,$DataSet->GetDataDescription(),255,255,255);
  60. $Test->setFontProperties("Fonts/tahoma.ttf",10);
  61. $Test->drawTitle(50,22,"wykres",50,50,50,585);
  62.  
  63. $Test->Stroke();
  64. ?>


za wszelka pomoc dziekuje
moze ktos niezmeczonym okiem jak na to popatrzy do bedzie wiedzial gdzie jest blad
Go to the top of the page
+Quote Post

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: 10.06.2026 - 20:38