Suppress jpgraph rendered legend if not displayed in Excel; ensure that left or right legends display as single column for each entry

This commit is contained in:
Mark Baker 2012-10-10 13:03:14 +01:00
parent 364f581ee4
commit dfcd839e61
1 changed files with 5 additions and 0 deletions

View File

@ -190,9 +190,11 @@ class PHPExcel_Chart_Renderer_jpgraph
switch ($legendPosition) {
case 'r' :
$this->_graph->legend->SetPos(0.01,0.5,'right','center'); // right
$this->_graph->legend->SetColumns(1);
break;
case 'l' :
$this->_graph->legend->SetPos(0.01,0.5,'left','center'); // left
$this->_graph->legend->SetColumns(1);
break;
case 't' :
$this->_graph->legend->SetPos(0.5,0.01,'center','top'); // top
@ -202,8 +204,11 @@ class PHPExcel_Chart_Renderer_jpgraph
break;
default :
$this->_graph->legend->SetPos(0.01,0.01,'right','top'); // top-right
$this->_graph->legend->SetColumns(1);
break;
}
} else {
$this->_graph->legend->Hide();
}
} // function _renderLegend()