Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data compression #13

Open
dogmatic69 opened this issue Nov 25, 2009 · 0 comments
Open

data compression #13

dogmatic69 opened this issue Nov 25, 2009 · 0 comments

Comments

@dogmatic69
Copy link
Owner

"; // And here's the function function chart_data($values) { // Port of JavaScript from http://code.google.com/apis/chart/ // http://james.cridland.net/code // First, find the maximum value from the values given $maxValue = max($values); // A list of encoding characters to help later, as per Google's example $simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $chartData = "s:"; for ($i = 0; $i < count($values); $i++) { $currentValue = $values[$i]; ``` if ($currentValue > -1) { $chartData.=substr($simpleEncoding,61*($currentValue/$maxValue),1); } else { $chartData.='_'; } ``` } // Return the chart data - and let the Y axis to show the maximum value return $chartData."&chxt=y&chxl=0:|0|".$maxValue; } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant