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