View unanswered posts | View active topics It is currently Thu May 09, 2024 7:43 pm



Reply to topic  [ 3 posts ] 
Problem with 0 on horizontal graph 
Author Message
New pChart user
New pChart user

Joined: Tue Mar 15, 2011 12:06 pm
Posts: 2
Post Problem with 0 on horizontal graph
Hello,

I have a small problem regarding the horizontal graph. If I have a bar with a value of '0' the 0 will be written outside the graph over the title.
I tried multiply things like changing the positions and the displayoffset. If I change the displayoffset to something negative like -12 then It appears to be fixed.
However the values bigger then 0 will move to the inside if I do that. They both go opposite directions. Void isn't an option cause I need to have the 0 on the graph.

I added a picture to this post with the problem.

Sorry for my bad English :-).

I hope somebody can help me out with this issue.
Thanks in advance!

Tom.


Attachments:
test.png
test.png [ 7.06 KiB | Viewed 6069 times ]
Sun Mar 20, 2011 4:37 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Problem with 0 on horizontal graph
Hi,

Indeed you catched a bug!

Replace the following line in the pDraw.class.php file located in the drawBarChart() function :
Code:
if ( $Serie["Data"][$Key] > 0 ) { $Align = TEXT_ALIGN_MIDDLELEFT; $Offset = $DisplayOffset; } else { $Align = TEXT_ALIGN_MIDDLERIGHT; $Offset = -$DisplayOffset; }

by :
Code:
if ( $Serie["Data"][$Key] >= 0 ) { $Align = TEXT_ALIGN_MIDDLELEFT; $Offset = $DisplayOffset; } else { $Align = TEXT_ALIGN_MIDDLERIGHT; $Offset = -$DisplayOffset; }


I've included this fix in the next minor subversion.

Thank you ;o)
JD.


Wed Mar 23, 2011 11:09 am
Profile WWW
New pChart user
New pChart user

Joined: Tue Mar 15, 2011 12:06 pm
Posts: 2
Post Re: Problem with 0 on horizontal graph
Thanks for your reply.

I found a solution to this bug my self a few days earlier. :D


Sat Mar 26, 2011 8:29 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 14 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