View unanswered posts | View active topics It is currently Sat Apr 27, 2024 3:16 pm



Reply to topic  [ 2 posts ] 
2 Y axis scales, need just one to start at 0 
Author Message
pChart user
pChart user

Joined: Sun May 19, 2013 10:40 pm
Posts: 4
Post 2 Y axis scales, need just one to start at 0
Hi

I have 2 Y axis on my graph. One has data starting at 0 but the scale gets draw starting at -2k (why?). If I use SCALE_MODE_START0 then it is fine, it starts at 0.

The problem is that then my other Y axis also starts at 0, but it's lowest data value is 200,000. I suddenly have a pretty flat line along the top of my graph.

How can I get one to start at 0 but let the other carry on as normal/automatically when you do not specified a mode?

I don't want to set them manually with SCALE_MODE_MANUAL or I'll have to regularly go in and change the maximum scale values I have set.

Thanks for your help


Sun May 19, 2013 10:48 pm
Profile
pChart user
pChart user

Joined: Sun May 19, 2013 10:40 pm
Posts: 4
Post Re: 2 Y axis scales, need just one to start at 0
Worked it out. If there's a better way I have missed though, please say :)

Code:
$min_series0 = $myData->getMin("series0");
$max_series0 = $myData->getMax("series0");
$min_series1 = $myData->getMin("series1");
$max_series1 = $myData->getMax("series1");

$AxisBoundaries = array(0=>array("Min"=>$min_series0,"Max"=>$max_series0),1=>array("Min"=>$min_series1,"Max"=>$max_series1));

$Settings = array(
   "Mode" => SCALE_MODE_MANUAL,
   "ManualScale"=>$AxisBoundaries
);

$myPicture->drawScale($Settings);


Mon May 20, 2013 9:26 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron