JpGraphを使用してデータをグラフ化しています。SetScale 関数を使用して y 軸の範囲を強制すると、出力が視覚的にグラフ領域からはみ出します。出力をグラフ領域にトリミングしたいと思います。
<?php
require_once ('include/jpgraph/jpgraph.php');
require_once ('include/jpgraph/jpgraph_line.php');
$datay1 = array(20,7,16,46,90,5,0,5,95);
// Setup the graph
$graph = new Graph(400,300);
$graph->title->Set('Graph Title');
$graph->title->font_size = 20;
$graph->SetScale("textlin",20,50);
//this version works but does not set the y-axis scale
//$graph->SetScale("textlin");
$p1 = new LinePlot($datay1);
$graph->Add($p1);
// Output line
$graph->Stroke();
?>
これは現在の出力です:
これは目的の出力です (Excel でレンダリング):