So I have this code :
if($farateze_dec == 0 or $farateze_dec == NULL)
{
$mediageneraladecembrie = VOID;
}
elseif($cuteze_dec == 9 or $cuteze_dec == NULL)
{
$mediageneraladecembrie = VOID;
}
else
{
$mediageneraladecembrie = round(($farateze_dec + $cuteze_dec) / ($numar_note_fara_teza_dec + $numar_note_cu_teza_dec),2);
}
//MEDIA PE Decembrie!
/* pChart library inclusions */
include("class/pData.class.php");
include("class/pDraw.class.php");
include("class/pImage.class.php");
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints(array(1,2,VOID,$mediageneraladecembrie,3,2,1,2), "Probe 1");
Which outputs this:
I tried to set $mediageneraladecembrie to be equal to 'VOID', but it still doesn`t work. Anyone knows how to do it?
I need it to be like so, in case the database doesn`t contains any values for the specified month.
Thanks!
LATER EDIT: If i declare the variable like $mediageneraladecembrie == VOID
, then it works, but gives this error Notice: Use of undefined constant VOID - assumed 'VOID' in C:\wamp\www\pgn\mu.php on line 887
So I finally managed to do it. I changed the following line in the file "/class/pData.class.php":
define("VOID", 0.123456789) to define("VOID" , 'VOID');
So now, if a variable has the value 'void' it will not appear in the graph.
Posting this answer hoping that it will help someone else in the same situation!