added tooltips for radar charts.

This commit is contained in:
Martynas Mickevicius
2010-07-21 19:32:17 +03:00
parent 2f78d2d147
commit 557eb2096b

View File

@@ -2198,6 +2198,28 @@
{ $XOffset = -$Width; } { $XOffset = -$Width; }
imagettftext($this->Picture,$this->FontSize,0,$X+$XOffset,$Y+$YOffset,$C_TextColor,$this->FontName,$Label); imagettftext($this->Picture,$this->FontSize,0,$X+$XOffset,$Y+$YOffset,$C_TextColor,$this->FontName,$Label);
if ( $this->BuildMap )
{
$vecX = $X - $XCenter;
$vecY = $Y - $YCenter;
// get a perpendicular vector
$vecXtemp = $vecX;
$vecX = -$vecY;
$vecY = $vecXtemp;
// normalization
$vecLength = sqrt($vecX * $vecX + $vecY * $vecY);
$vecX = $vecX / $vecLength;
$vecY = $vecY / $vecLength;
$offset = 10;
$this->addPointToImageMap($X+$vecX*-$offset,$Y+$vecY*-$offset,$Label,'Value','Radar');
$this->addPointToImageMap($X+$vecX*+$offset,$Y+$vecY*+$offset,$Label,'Value','Radar');
$this->addPointToImageMap($XCenter+$vecX*+$offset,$YCenter+$vecY*+$offset,$Label,'Value','Radar');
$this->addPointToImageMap($XCenter+$vecX*-$offset,$YCenter+$vecY*-$offset,$Label,'Value','Radar');
}
} }
} }
@@ -2748,6 +2770,8 @@
} }
} }
if ( $this->BuildMap )
{
/* Add points to Image Map. /* Add points to Image Map.
* The center point abd the first, middle and last of the arc is taken. * The center point abd the first, middle and last of the arc is taken.
*/ */
@@ -2766,6 +2790,7 @@
$middle = count($PointArr)/2; $middle = count($PointArr)/2;
$this->addPointToImageMap($PointArr[$middle + ($middle % 2)],$PointArr[$middle + ($middle % 2)+1],$Data[$key][$DataDescription['Values'][1]],$Data[$key][$DataDescription['Values'][0]],"Pie"); $this->addPointToImageMap($PointArr[$middle + ($middle % 2)],$PointArr[$middle + ($middle % 2)+1],$Data[$key][$DataDescription['Values'][1]],$Data[$key][$DataDescription['Values'][0]],"Pie");
} }
}
/* Draw Top polygons */ /* Draw Top polygons */
for($Key=count($iValues)-1;$Key>=0;$Key--) for($Key=count($iValues)-1;$Key>=0;$Key--)