I have some data in mysql that I load up in php and draw a line chart using the google chart api.
Here is part of the code:
// ... do a sql query , then loop and create a chart ...
while($row=mysql_fetch_array($result))
{
$values[0][]=$row['v1'];
$values[1][]=$row['v2'];
}
$width=600;
$height=500;
$scaleMin=0;
$scaleMax=99;
$chart = new GoogleChart('lc', $width,$height );
$chart->setAutoscale(GoogleChart::AUTOSCALE_OFF);
// ... other google chart setup code
$line = new GoogleChartData($values[0]);
$line->setAutoscale(false);
$line->setScale($scaleMin,$scaleMax);
$line->setLegend('value1');
$chart->addData($line);
$line = new GoogleChartData($values[1]);
$line->setAutoscale(false);
$line->setScale($scaleMin,$scaleMax);
$line->setLegend('value2');
$chart->addData($line);
// ... more lines and chart set up ...
header('Content-Type: image/png');
echo $chart;
So that works fine, except that my "value1" or "v1" data will generally range from a minimum of 10 to a maximum of 90. My "value2" or "v2" data will start off at 0, and over time will increment - potentially to 100,000 or more.
I am trying to figure out how to either set the google chart up so it will display it somehow, OR potentially alter the data in the array so it displays properly.
Currently, it would draw a line, starting a 0, then hour by hour it would climb a little, forming a staircase-like shape. The problem is, it eventually goes past 99, and you have no more line, or similar.
Just looking for some thoughts.