Znalazłem na stronie http://pchart.sourceforge.net/ przykładowe wykresy. Chciałem je wrzucić na moją strone, ale nie wychodzi to tak jak bym chciał. Mam u siebie zainstalowanego xamppa i Gd które jest wymagane do tych wykresów też jest. Kiedy wrzuce kod tego wykresu do nowego pliku php to wykres sie pojawia na stronie i wszstko gra, ale kiedy wrzuce go na strone to pojawiają sie krzaki i nic nie wychodzi.
ten skrypt ze strony to
include("pChart/pData.class"); include("pChart/pChart.class"); // Dataset definition $DataSet = new pData; $DataSet->AddSerie(); $DataSet->SetSerieName("Sample data","Serie1"); // Initialise the graph $Test = new pChart(700,230); $Test->setFontProperties("Fonts/tahoma.ttf",10); $Test->setGraphArea(260,230,680,200); $Test->drawGraphArea(250,250,250); $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2); $Test->drawGrid(4,TRUE,230,230,230,255); // Draw the line graph $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription()); $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255); // Finish the graph $Test->setFontProperties("Fonts/tahoma.ttf",8); $Test->drawLegend(45,35,$DataSet->GetDataDescription(),255,255,255); $Test->setFontProperties("Fonts/tahoma.ttf",10); $Test->drawTitle(60,22,"My pretty graph",50,50,50,585); $Test->Stroke();
Kiedy dodam do tego funkcje które tworzą szablon strony to nic nie wychodzi. Wygląda to wtedy tak
<?php require('funkcje_dolaczone.php'); naglowek_html(); menu_pionowe_html(); include("pChart/pData.class"); include("pChart/pChart.class"); // Dataset definition $DataSet = new pData; $DataSet->AddSerie(); $DataSet->SetSerieName("Sample data","Serie1"); // Initialise the graph $Test = new pChart(700,230); $Test->setFontProperties("Fonts/tahoma.ttf",10); $Test->setGraphArea(260,230,680,200); $Test->drawGraphArea(250,250,250); $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2); $Test->drawGrid(4,TRUE,230,230,230,255); // Draw the line graph $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription()); $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255); // Finish the graph $Test->setFontProperties("Fonts/tahoma.ttf",8); $Test->drawLegend(45,35,$DataSet->GetDataDescription(),255,255,255); $Test->setFontProperties("Fonts/tahoma.ttf",10); $Test->drawTitle(60,22,"My pretty graph",50,50,50,585); $Test->Stroke(); stopka_html(); ?>
A na stonie pojawia się coś takiego
