|
Chart.NoValue |
Posted by Jorge Eduardo on Apr-24-2014 04:12 |
|
Hi Peter,
I want to know how to deal with missing values, instead of representing them as ZERO. I
found in last posts the use of Chart.NoValue. However haven't been able to properly use.
As I understand it replaces missing values with the NoValue specification. My question is
how do I use NoValue in a data array in PHP.
Actually I get data using this:
$data1= explode(",", $_GET["data1"]);
$data2= explode(",", $_GET["data2"]);
and add data sets using this:
$dataSetObj = $layer->addDataSet($data1, 0xcf4040, "Peak");
$dataSetObj->setDataSymbol(SquareSymbol, 7);
Where and how do I place the Chart.NoValue? I've tried on both but no result.
Thanks in advance, Jorge Eduardo |
Re: Chart.NoValue |
Posted by Peter Kwan on Apr-25-2014 00:20 |
|
Hi Jorge,
I am not sure how do you representing missing value in your data1 and data2. Suppose you
use 0 to represent missing value. ChartDirector uses NoValue to represent missing values,
so you need to change the 0 into NoValue before passing your data to ChartDirector. For
example:
for ($i = 0; $i < count($data1); ++$i)
if ((int)$data[$i] == 0) $data[$i] = NoValue;
(The Chart.NoValue is the syntax in Java, C# and VB.NET. In PHP, the syntax is NoValue. In
C++, the syntax is Chart::NoValue .....).
Hope this can help.
Regards
Peter Kwan |
Re: Chart.NoValue |
Posted by Jorge Eduardo on Apr-26-2014 04:11 |
|
Thanks Peter, that's what I was looking for. |
|