2016-05-31 17 views
0

jpgraphに2つの関数を追加する必要があります。 1.凡例の線の幅を広げる 2.凡例で円を外す凡例の線幅を広げて凡例の円を外す

凡例の線の太さを設定できます。凡例では幅を設定してサークルマークを削除することはできません。しかし、折れ線グラフに円マークを表示したい。

$datay1 = array(20,15,23,15); 

// Setup the graph 
$graph = new Graph(300,250); 
$graph->SetScale("textlin"); 
$graph->title->Set('Filled Y-grid'); 
$graph->SetBox(false); 
$graph->yaxis->HideZeroLabel(); 
$graph->yaxis->HideLine(false); 
$graph->yaxis->HideTicks(false,false); 
$graph->xgrid->Show(); 
$graph->xgrid->SetLineStyle("solid"); 
$graph->xaxis->SetTickLabels(array('A','B','C','D')); 
$graph->xgrid->SetColor('#E3E3E3'); 

// Create the first line 
$p1 = new LinePlot($datay1); 
$graph->Add($p1); 
$p1->SetColor("red"); 
$p1->SetWeight(2); 
$p1->SetLegend('Line 1'); 
$p1->mark->SetType(MARK_FILLEDCIRCLE); 
$p1->mark->SetFillColor('#FFFFFF'); 
$graph->legend->SetFrameWeight(0); 
$graph->legend->SetLineWeight(3); 
$graph->legend->SetPos(0.03,0.87,'left','bottom'); 

// Output line 
$graph->Stroke(); 

サンプルデータとPICが添付されている... enter image description here

任意のアイデア感謝..おかげで

答えて

0

私はそれは不可能だと思いますが、望ましい結果を得るためにこの問題を回避するには、追加することですあなたのコードに従ってください:

$graph->legend->SetMarkAbsVSize(0); 

そして、jpgraph_legend.inc.phpを編集してください。行を探します。

$p[2]->Stroke($aImg,$x1,$marky); 

とに置き換える:

if ($this->mark_abs_vsize !=0) $p[2]->Stroke($aImg,$x1,$marky); 

SetMarkAbsVSizeがゼロに設定されている場合、今マークが表示されません。

線幅は常にプロット内の線幅と同じです。