Display bigger legend labels correctly without overlapping
This commit is contained in:
parent
1732fa90e8
commit
76d3e5435f
|
@ -66,13 +66,14 @@ class Legend implements Drawable
|
|||
$outer->getLayout()->setPadding(2, 2, 2, 2);
|
||||
$nrOfColumns = 4;
|
||||
|
||||
$leftstep = 100 / $nrOfColumns;
|
||||
$topstep = 10 / $nrOfColumns + 2;
|
||||
|
||||
$top = 0;
|
||||
$left = 0;
|
||||
$lastLabelEndPos = -1;
|
||||
foreach ($this->dataset as $color => $text) {
|
||||
$leftstep = 100 / $nrOfColumns + strlen($text);
|
||||
|
||||
// Make sure labels don't overlap each other
|
||||
while ($lastLabelEndPos >= $left) {
|
||||
$left += $leftstep;
|
||||
|
|
Loading…
Reference in New Issue