Adrielpin / gchartphp

Automatically exported from code.google.com/p/gchartphp
0 stars 0 forks source link

Max Values #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Thanks for the code!

What I don’t like about Google chart API is the fact axis don’t have 
nothing to do with values.

Thus, in order for a simple x,y graph to make sense, you have to find the 
percentage of all your values and then plot them. I mean, if your max 
value is 150, you must make 150=100% and then calculate all values below 
it in terms of percentage. Your laber on the x axe will be 150, but your 
value will be 100%.

Regards,
Jose

Original issue reported on code.google.com by josemaug...@gmail.com on 7 Jan 2008 at 5:03

GoogleCodeExporter commented 8 years ago
If you replace this line (104):

$retStr .= "&chxr=0,1,4|1,1,10";

with:

$retStr .= "&chxr=0,1,4|1,1,".utility::getMaxOfArray($this->values);

the getAxesString method becomes:

        protected function getAxesString(){
            $retStr = "&chxt=x,y";
            $retStr .= "&chxr=0,1,4|1,1,".utility::getMaxOfArray($this->values);
            return $retStr;
        }

Cheers, Marko

Original comment by m.van.de...@gmail.com on 22 Apr 2008 at 4:01

GoogleCodeExporter commented 8 years ago
Thanks for the patch, this actually makes scaling work as expected. Is the 
author
reading this?? ;)

Original comment by toupeir...@gmail.com on 1 Jul 2009 at 2:40

GoogleCodeExporter commented 8 years ago
Fixed with the changes in rev. 14

Original comment by bardellie on 12 May 2010 at 11:48