Buon giorno,
ho lo stesso problema riscontrato da questo utente viewtopic.php?t=361625 , anche se non ho capito come l' ha risolto!!
Ho imparato a generare grafici con Jpgraph, vorrei inserire questa immagine in un pdf.
graficomedia.php mi genera un grafico, il codice è :
<?php
require 'gapi.class.php';
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
define('ga_account',$_GET['user']);
define('ga_password',$_GET['pass']);
define('ga_profile_id',$_GET['id']);
$ordine = $_GET['ordine'];
$ga = new gapi(ga_account,ga_password);
$ga->requestReportData(ga_profile_id, array($ordine), array(avgTimeOnSite, pageViews, newVisits, percentNewVisits, visitBounceRate));
$gaResults = $ga->getResults();
$x = 0;
foreach($gaResults as $result) {
$variabile = $result->getAvgTimeOnSite();
$AvgTimeOnSite[$x] = $variabile;
if ($ordine == 'country'){
$variabile = $result->getCountry();
}
elseif ($ordine == 'browser'){
$variabile = $result->getBrowser();
}
elseif ($ordine == 'operatingSystem' ){
$variabile = $result->getOperatingSystem();
}
else {
print "IMPOSSIBILE";
}
$ricerca[$x] = $variabile;
$x++;
}
// Create the graph. These two calls are always required
$graph = new Graph(590,325);
$graph->SetScale("textlin");
//$theme_class="DefaultTheme";
//$graph->SetTheme(new $theme_class());
// set major and minor tick positions manually
$graph->yaxis->SetTickPositions(array(0,200,400,600,900,1200), array(15,45,75,105,135));
$graph->SetBox(false);
//$graph->ygrid->SetColor('gray');
$graph->ygrid->SetFill(false);
$graph->xaxis->SetTickLabels($ricerca);
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
// Create the bar plots
$b1plot = new BarPlot($AvgTimeOnSite);
// ...and add it to the graPH
$graph->Add($b1plot);
$b1plot->SetColor("white");
$b1plot->SetFillGradient("#4B0082","white",GRAD_LEFT_REFLECTION);
$b1plot->SetWidth(45);
$graph->title->Set("Tempo medio nel sito");
// Display the graph
$graph->Stroke();
?>
Ovviamente user e pass saranno forniti da un' altra pagina ( metodo get...). Ad ogni modo questa pagina mi funziona, come faccio a fare comparire questa pagina in un pdf?
Grazie mille:)


