pChart 2.x forum
http://wiki.pchart.net/forum/

drawZoneChart and ignoring VOID values
http://wiki.pchart.net/forum/viewtopic.php?f=1&t=29432
Page 1 of 1

Author:  michjans [ Mon Jul 16, 2012 3:38 pm ]
Post subject:  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

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/