I think the issue is that you are using the lxy chart type, which
requires both x and y coordinates, and your chd only provides x.

On Apr 22, 11:04 pm, Peter Fleck <pfhy...@gmail.com> wrote:
> Here is the file. There's a bit of additional code to write to disk too that
> I excluded. This works without a problem when I pass in a string with basic
> formatting. This example has the extended formatting string set in place for
> the chd value.
>
> <?php
>   header('content-type: image/png');
>   \$url = 'https://chart.googleapis.com/chart?chid='. md5(uniqid(rand(),
> true));
>
>   // Add data, chart type, chart size, and scale to params.
>   \$chart = array(
>    'chds' => '0,1',
>    'chxr' => '0,100,200,50',
>    'chxs' =>
> '0,676767,9.167,0.5,lt,676767|1,676767,12,0,lt,676767|2,676767,12,0,lt,6767 
> 67',
>    'chxt' => 'y,x,x',
>    'chxtc' => '0,-700|1,12|2,25',
>    'chxtc' => '0,-700|1,-500|2,-500',
>    'chxl' => '$dateData',
>    'chxp' => '$tickData',
>    'chs' => '700x400',
>    'cht' => 'lxy',
>    'chco' => 'FF0000,00FF00,0000FF,000000',
>    'chd' => '$cData',
>    'chd' => 'e:B.CrCyB3CXCXCqC6Cq',
>    'chdl' => 'TP TSI|Mean TSI|Chla TSI|Secchi TSI',
>    'chdlp' => 'b',
>    'chg' => '0,5,0,4',
>    'chls' => '2,4,1|2,4,1|2,4,1|2,4,1',
>    'chma' => '5,5,5,25',
>    'chm' =>
> 's,FF0000,0,-1,7|o,FF0000,1,-1,8,-1|d,008000,2,-1,8|c,000000,3,-1,8',
>    'chtt' => '$chartTitle',
>    'chts' => '000000,18');
>
>   // Send the request, and print out the returned bytes.
>   \$context = stream_context_create(
>     array('http' => array(
>       'method' => 'POST',
>       'content' => http_build_query(\$chart))));
>   fpassthru(fopen(\$url, 'r', false, \$context));
> ?>
> EOD;

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to google-chart-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-chart-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to