我已經使用jpgraph創建了一個圖形 - 它可以工作,但是由於我x軸上的標籤長度有些文本是'關閉'an不可見。我創建了一個自定義函數來使用換行符,但即使如此,它仍然會剪裁圖表上某個標籤上的幾個字符。在jpgraph(圖表)中更改x軸上標籤的長度
有沒有一種方法來實際定義x軸標籤的實際長度,例如設置一個以像素爲單位的寬度?由於
// Create the graph. These two calls are always required
$graph = new Graph(1000,500,'auto');
$graph->SetScale("textlin");
//$theme_class="DefaultTheme";
//$graph->SetTheme(new $theme_class());
// set major and minor tick positions manually
$graph->yaxis->SetTickPositions(array(0,1,2,3,4,5), array(0.5,1.5,2.5,3.5,4.5));
$graph->SetBox(false);
//$graph->ygrid->SetColor('gray');
$graph->ygrid->SetFill(false);
$graph->xaxis->SetLabelAngle(90); // 45 degrees angle
$graph->xaxis->SetTickLabels($new_labels);
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
// Create the bar plots
$b1plot = new BarPlot($data);
// ...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("Bar Gradient(Left reflection)");
// Display the graph
$graph->Stroke();
儘管jpgraph是基於php的,但這不是PHP的問題。因爲這個,我刪除了PHP標籤。 – Matt 2012-08-01 15:54:11