[ vecitiKrivac @ 19.09.2007. 09:20 ] @
Zdravo. koristim jpgraph-2.2 klasu za crtanje dijagrama, i tu mi se javlja problem ako su u nizu veliki brojevi (veci od 6 cifara), naziv y ose preklapa te brojeve. Sa pomeranjem leve margine samo povecavam efektivni prostor dijagrama, tj. i dalje ne mogu da razdvojim title od cifara y ose. Zanima me da li se neko od vas sretao sa ovim problemom, i naravno kako je uspeo to da resi. Code: /// $datay1 = Array ( 0 => 100000.00, 1 => 20.00, 2 => 30.00, 3 => 123456, 4 => 46564, 5 => 464644, 6 => 465465, 7 => 464646, 8 => 46546, 9 => 46546, 10 => '', 11 => '' ); $datay2 = Array ( 0 => 30454.00, 1 => 304545.00, 2 => 40454.00, 3 => '', 4 => '', 5 => '', 6 => '', 7 => '', 8 => '', 9 => '', 11 => '', 11 => '' ); /// $months = array_merge ($cfgMon, array ('Target')); // Create the graph. These two calls are always required $graph = new Graph(700,400,'auto'); $graph->SetScale('textlin'); $graph->yaxis->scale->SetGrace(30); $graph->title->Set("volumes $YearFrom"); $graph->yaxis->title->Set("Volume (hL)"); $graph->yaxis->HideZeroLabel(); $graph->ygrid->SetFill(true,'#[email protected]','#[email protected]'); $graph->xgrid->Show(); $graph->title->SetFont(FF_FONT1,FS_BOLD); $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->xaxis->SetTickLabels($months); // Create the first line $p1 = new LinePlot($datay1); $p1->SetColor("black"); $p1->SetLegend('Actuals'); $graph->Add($p1); // Create the second line $p2 = new LinePlot($datay2); $p2->SetColor("red"); $p2->SetLegend('Estimates'); $graph->Add($p2); $graph->legend->SetShadow('[email protected]',5); $graph->legend->SetPos(0.1,0.1,'right','top'); // Output line $graph->Stroke('images/stats/graph_volume_report4.png'); Mislim da cu da prosledim i sliku koja ce najbolje da prikaze ovaj problem. Pozdrav |