I followed the wiki artichle (http://codeigniter.com/wiki/gchart/revision/5312/) to practice google chart in my CI 2.0. 
But it doesn't work.

controller file: ci\application\helpers\mytest.php

```
$this->load->helper( 'gchart' );
$this->load->view('my_test');

```

view file: ci\application\helpers\my\_test.php

```
$encoded_data = extendedencode(array(0, 1, 2, 3, 4, 5, 6) &maxvalue;);
echo <<< EOS
     <img src="
        http://chart.apis.google.com/chart?
            cht=lc
            &chs=250x250
            &chd;:e{$encoded}
        "
        alt="line graph of some example data" />
EOS;

```

help file: ci\application\helpers\gchart\_helper.php

```
// I do copied all the source code from the wiki url link above.

```

When I try to charted by CI.
It showed error as this,
**Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\demo\ci\application\views\my\_test.php on line 54**

Any thing wrong on my operation?
I compared the extendedencode() from gchart\_helper.php

```
function extendedencode($data, &$maxvalue='notspecified')

```

and extendedencode() from my\_test.php

```
$encoded_data = extendedencode(array(0, 1, 2, 3, 4, 5, 6) &maxvalue;);

```

Then I updated the extendedencode() line to this in my\_test.php view file,

```
$encoded_data = extendedencode(array(0, 1, 2, 3, 4, 5, 6), &maxvalue);

```

And try again, but still get this error below. 

**Parse error: syntax error, unexpected ')', expecting T\_PAAMAYIM\_NEKUDOTAYIM in C:\xampp\htdocs\demo\ci\application\views\my\_test.php on line 54**

Any help or comments are great appreciated.

[updated]

```
When I use the formated below, 

$encoded_data = extendedencode(array(0, 1, 2, 3, 4, 5, 6) &maxvalue);

showed another four error message.

Events List

A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant maxvalue - assumed 'maxvalue'

Filename: views/my_test.php

Line Number: 54

A PHP Error was encountered

Severity: Warning

Message: max() [function.max]: When only one parameter is given, it must be an array

Filename: helpers/gchart_helper.php

Line Number: 49

A PHP Error was encountered

Severity: Warning

Message: Division by zero

Filename: helpers/gchart_helper.php

Line Number: 55

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: encoded

Filename: views/my_test.php

Line Number: 61

```

**[Updated against Frank's suggestion]**

There are still two errors occurred below,

```
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 64

Filename: helpers/gchart_helper.php

Line Number: 65  // code line: $ret .= $grid[$x].$grid[$y];

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: encoded

Filename: views/my_test.php

Line Number: 61 // code line: &chd;:e{$encoded}

```