View unanswered posts | View active topics It is currently Thu May 16, 2024 1:32 pm



Reply to topic  [ 6 posts ] 
Problem with void 
Author Message
New pChart user
New pChart user

Joined: Thu Mar 24, 2011 1:56 am
Posts: 3
 Problem with void
Hi,

If i leave null values als null, i got the following graph:
Attachment:
lineChartNULL.png
lineChartNULL.png [ 13.74 KiB | Viewed 8541 times ]

like expected

if i set it to VOID, the following line chart will be generated:
Attachment:
lineChartVOID.png
lineChartVOID.png [ 5.85 KiB | Viewed 8541 times ]

Not what i've expected...

where is my mistake?

THX 4 Help

Array null:
Code:

Array
(
    [TimeStamp] => Array
        (
            [0] => 2011-03-19 12:26:39
            [1] => 2011-03-21 06:52:51
            [2] => 2011-03-22 07:45:20
            [3] => 2011-03-23 09:02:27
            [4] => 2011-03-23 07:30:35
        )

    [8] => Array
        (
            [SuperE10] => Array
                (
                    [0] => 1.519
                    [1] =>
                    [2] =>
                    [3] => 1.529
                    [4] =>
                )

        )

    [9] => Array
        (
            [SuperE10] => Array
                (
                    [0] =>
                    [1] => 1.449
                    [2] => 1.529
                    [3] =>
                    [4] => 1.519
                )

        )

)


Array VOID:
Code:
Array
(
    [TimeStamp] => Array
        (
            [0] => 2011-03-19 12:26:39
            [1] => 2011-03-21 06:52:51
            [2] => 2011-03-22 07:45:20
            [3] => 2011-03-23 09:02:27
            [4] => 2011-03-23 07:30:35
        )

    [8] => Array
        (
            [SuperE10] => Array
                (
                    [0] => 1.519
                    [1] => 0.12345
                    [2] => 0.12345
                    [3] => 1.529
                    [4] => 0.12345
                )

        )

    [9] => Array
        (
            [SuperE10] => Array
                (
                    [0] => 0.12345
                    [1] => 1.449
                    [2] => 1.529
                    [3] => 0.12345
                    [4] => 1.519
                )

        )

)


where is my mistake?


Last edited by Megachip on Thu Mar 24, 2011 10:58 am, edited 1 time in total.



Thu Mar 24, 2011 2:10 am
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Problem with void
Hi,

No mistake, the script is working as expected :

- NULL is equal to 0 in PHP
- VOID means "no value" in pChart.

Kind regards,
JD.


Thu Mar 24, 2011 8:51 am
Profile WWW
New pChart user
New pChart user

Joined: Thu Mar 24, 2011 1:56 am
Posts: 3
Post Re: Problem with void
But there are values, as you can see... Why they aren't draw?


Thu Mar 24, 2011 10:38 am
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Problem with void
Because to draw a line you need two points. Try to draw a plotchart instead of a line chart.

Kind regards,
JD.


Thu Mar 24, 2011 11:08 am
Profile WWW
New pChart user
New pChart user

Joined: Thu Mar 24, 2011 1:56 am
Posts: 3
Post Re: Problem with void
Erm... there are 2 or 3 points... so it should draw a line ;) (as you see in array)


Thu Mar 24, 2011 12:05 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Problem with void
Let me complete the last statement :

"Because to draw a line you need two points that are not breaked"

If you want to link the non contiguous points --which isn't the way a basic chart is supposed to be-- you can specify it using the BreakVoid parameter of the drawLineChart() function. What you are experiencing is document on the function page : drawLineChart() in the "Handling of missing points" section.

Kind regards,
JD.


Thu Mar 24, 2011 12:41 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

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