2014-01-17 5 views
0

jpgraph의 모든 x 축 값을 지정하는 방법이 있습니까? 많은 연구 끝에 틱 범위 또는 최소값과 최대 값을 지정하는 방법을 찾았습니다. 지난 24 시간 (오후 3시, 오후 4시, 오후 5시 .... 2시)과 같이 X 축에 전달할 개별 값이 있습니다.Jp 그래프의 모든 x 축 값 사용자 정의 PHP

여기에 x 축을 0, 1, 2, 0.24로 자동 조절하는 기존 코드가 있습니다.

신속한 답변을 위해
$graph = new Graph(400,200); 
$graph->SetScale('textlin'); 
$graph->SetShadow(); 
$graph->img->SetMargin(40,30,40,40); 

$bplot = new BarPlot($datay); 
$graph->Add($bplot); 
$txt=new Text($text); 
$txt->SetPos(0,20); 
$txt->SetColor('darkred'); 
$txt->SetFont(FF_FONT2,FS_BOLD); 
$graph->AddText($txt); 

$graph->title->Set($name); 
$graph->xaxis->title->Set("Last 24 Hours"); 
$graph->yaxis->title->Set("Ticket Count"); 

$graph->title->SetFont(FF_FONT1,FS_BOLD); 
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); 
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); 
$graph->Stroke(); 

답변

1

, 여기 내가 찾은 것입니다

$graph->xaxis->SetTickLabels(array(1,2,3,4);