View unanswered posts | View active topics It is currently Sun Apr 28, 2024 10:59 pm



Reply to topic  [ 3 posts ] 
bug in drawScale() w/ AxisAlpha + suggestion 
Author Message
New pChart user
New pChart user

Joined: Sun Jan 16, 2011 2:15 pm
Posts: 3
Post bug in drawScale() w/ AxisAlpha + suggestion
hi guys, thanks for a great lib. I've noticed a bug or two so thought i'd post.

in 2.0.12, in pDraw.class

I believe this says:
Code:
$AxisAlpha      = isset($Format["AxisAlpha"]) ? $Format["GridAlpha"] : 100;

and throws a notice (or warning?) when using axisalpha but not gridalpha

working:
Code:
$AxisAlpha      = isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;


- - 8< - - snip - -

I wasn't sure where to suggest this so:
sometimes it is required to produce a bar chart that shows deviation from a custom value, i.e. bars wrapping not around zero but arbitrary value. I struggled to produce this using ordinary methods (yes you can but on close inspection the bars are wrong), so here's a proposed code change:

Code:
// ... set $nonZeroValue first, invoke with
$image->drawBarChart(array('AroundZero'=>true, 'YZero'=>$nonZeroValue));  // wrap bars around arbitrary value


in pDraw::drawBarChart()

Code:
$OverrideYZero = (isset($Format['YZero'])) ? $Format['YZero'] : 0;
...
if ($OverrideYZero != 0) $YZero = $this->scaleComputeY($OverrideYZero,array("AxisID"=>$Serie["Axis"]));   // override by user
else $YZero    = $this->scaleComputeY(0,array("AxisID"=>$Serie["Axis"])); // default


- - 8< - - snip - -

(finally, as a suggestion, environments like Zend assign .class files to Java instead of PHP. This breaks code completion and other project functionality.
Consider .class.php)


hope this works :]


Sun Jan 16, 2011 2:31 pm
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: bug in drawScale() w/ AxisAlpha + suggestion
Fixed the issue with the AxisAlpha switch.

I'll add the option to modify the Y wrapping value for the bar charts based on a fixed treshold or another data serie.

Regarding the class extension, I've already get this feedback once. The issue is that it wouldn't be fair to rename the classes for all the users that have started to code with the 2.0, this would require that they modify all the class inclusions from their scripts. Maybe we can place a poll for this?

Kind regards,
JD.


Sun Jan 16, 2011 6:57 pm
Profile WWW
New pChart user
New pChart user

Joined: Sun Jan 16, 2011 2:15 pm
Posts: 3
Post Re: bug in drawScale() w/ AxisAlpha + suggestion
jean-damien wrote:
Regarding the class extension, I've already get this feedback once. The issue is that it wouldn't be fair to rename the classes for all the users that have started to code with the 2.0, this would require that they modify all the class inclusions from their scripts.

This is more of a technical-design question. I do believe a user would be happy with a single point of inclusion for the whole library in their init scripts, such as
Code:
require "pChart2/lib.pchart.php";

.. that then includes all pChart classes in valid order. The CPU+disk cost of this is minimal. But the outcome is you have a convenient proxy that works fine should you decide to make more drastic changes later.

I am new to pChart2 (but not to pChart) as I guess many other users are. I found it a bit puzzling that I have to include pDraw, pImage, and pPie separately (even though I can see how this makes sense). My theory, seeing that pChart2 is fresh, is that some of the early changes will be seen as investment more than hassle.


Sun Jan 16, 2011 8:06 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

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