View unanswered posts | View active topics It is currently Thu Mar 28, 2024 1:37 pm



Reply to topic  [ 1 post ] 
drawZoneChart and ignoring VOID values 
Author Message
pChart user
pChart user

Joined: Wed Jun 27, 2012 1:22 pm
Posts: 5
Post drawZoneChart and ignoring VOID values
Hello,
I am using drawZoneChart to mark an area between two series. These series contain VOID values at the end of the range, but drawZoneChart doesn't ignore these values. This results in straight lines being drawn across the image at the end/beginning of the zone. I couldn't find a setting to ignore the VOID values, so I think drawZoneChart doesn't support this.

I have made a modification in drawZoneChart that partially fixed my problem (only for series that have VOID values at the end):

added on line 3864 of pChart 2.1.3/class/pDraw.class.php:
Code:
         if ($Y1 == VOID) continue;


For completeness, this is the complete foreach block (I only added it for Orientation SCALE_POS_LEFTRIGHT):
Code:
       foreach($PosArrayA as $Key => $Y1)
        {
         if ($Y1 == VOID) continue; //FIX: Ignore VOID
         $Y2 = $PosArrayB[$Key];

         $BoundsA[] = $X; $BoundsA[] = $Y1;
         $BoundsB[] = $X; $BoundsB[] = $Y2;

         $LastX = $X;
         $LastY1 = $Y1; $LastY2 = $Y2;

         $X = $X + $XStep;
        }


This fix only works for VOID values at the end of the series, but not at the beginning (in that case the zone is moved the skipped VOID values to the left).
I'm also not sure what will happen when there are VOID values, in between the series.
Does anybody know a better fix that works for all cases?

Michiel


Mon Jul 16, 2012 3:38 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

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