Re: Google Charts’ simpleEncode in PHP

2009-07-31 Thread KeithB
Both simpleEncode() functions (js and php) support a maxValue parameter but your PHP version defaults the max value to the maximum value in your array. As such the PHP version is scaling your data as if it was specified in the 0--61 range. Your 39 becomes (39 / 43) * 61 = 55 (or s:3) Your 43

Google Charts’ simpleEncode in PHP

2009-07-30 Thread Nick
The docs for the new Google Charts API include a Javascript function called simpleEncode. It demonstrates encoding a data set into a “Simple encoding” as expected by the API...followed by a PHP function which does the same thing. function simpleEncode($values, $maxValue=-1) {