Menu

#2 Set ranges for Y axis

open
nobody
None
5
2002-09-25
2002-09-25
Anonymous
No

I am generating charts which need to have particular ranges for
each of the left and right Y axes. In my sample data, I want the
left axis to range between +120 and -120. The right axis should
range between +71.2 and -71.2.

I have tried to use the class methods SetYmin() and SetYmax. It
seems to work for the right axis but is not altering the left axis.
The right axis goes higher than I want as a result and the two
graphs are not scaled appropriately as a result.

Here is how I have called the functions:

$g->SetYmax( 120,0);
$g->SetYmin(-120,0);
$data1 = $g->AddData($x,$qs1,"Sentence Length");

$g->use_axis2 = 1;
$g->SetYmax( 72,1);
$g->SetYmin(-72,1);
$data2 = $g->AddData($x,$qs2,"Characteristic");

My working sample is presently located at

http://linux.ncc.sdccd.net/~keeline/qsum2.php?o=g

Although my program is under continual development, I will try to
keep this version static until someone can look at it.

James D. Keeline

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.