View unanswered posts | View active topics It is currently Sat Apr 27, 2024 9:55 pm



Reply to topic  [ 6 posts ] 
pPie : drawPieLegend bug 
Author Message
New pChart user
New pChart user

Joined: Wed Jun 29, 2011 11:11 pm
Posts: 1
Post pPie : drawPieLegend bug
Hello,

There's a small bug in pPie, the drawPieLegend function (in 2.1.0, haven't looked in 2.1.1)
The FontName and FontSize argument are ignored when writing the legend text.


I fixed it, starting from line 686
Code:
if ( $Mode == LEGEND_VERTICAL )
        {
         $this->pChartObject->drawText($X+$BoxSize+4,$Y+$BoxSize/2,$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontName"=>$FontName,"FontSize"=>$FontSize));
         $Y=$Y+$YStep;
        }
       elseif ( $Mode == LEGEND_HORIZONTAL )
        {
         $BoxArray = $this->pChartObject->drawText($X+$BoxSize+4,$Y+$BoxSize/2,$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontName"=>$FontName,"FontSize"=>$FontSize));
         $X=$BoxArray[1]["X"]+2+$XStep;
        }



I love the library, really good work !


Wed Jun 29, 2011 11:16 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: pPie : drawPieLegend bug
Just fixed it for the next version.

Thanks for having raised it!

Kind regards,
JD.


Wed Aug 03, 2011 1:21 pm
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: pPie : drawPieLegend bug
The 2.1.2 version has been published yesterday correcting this bug and is now available for download at http://www.pchart.net/download.

JD.


Fri Aug 05, 2011 8:50 am
Profile WWW
New pChart user
New pChart user

Joined: Tue Aug 23, 2011 3:50 pm
Posts: 2
Post Re: pPie : drawPieLegend bug
Seems like the bug is still not fixed for me in 2.1.2.
I had to insert the parameters manually into the drawText calls as well (lines 1715 and 1725 in pDraw.class.php):
Code:
$this->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontSize"=>$FontSize,"FontName"=>$FontName));
/* ... */
$BoxArray = $this->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontSize"=>$FontSize,"FontName"=>$FontName));


Tue Aug 23, 2011 3:55 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: pPie : drawPieLegend bug
The original issue was related to the pie legend function, the one you're reporting is related to the basic legend function, that's why it remains. Just fixed it for the next sub release.

Thank you for having reported it ;o)

JD.


Wed Aug 24, 2011 6:57 am
Profile WWW
New pChart user
New pChart user

Joined: Tue Aug 23, 2011 3:50 pm
Posts: 2
Post Re: pPie : drawPieLegend bug
Sure thing, thanks for creating a beautiful library :D


Wed Aug 24, 2011 10:04 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron