
10-23-07, 03:08 AM
|
|
Newbie Coder
|
|
Join Date: Oct 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
JPgraph
Hi,
I have set the width as 850.
How can I set the width as 250px and plot the values of array limit to 125px.
I want the width and height as 850 and 250. but the graph drawn should not cover the 250 spacing it should plot only till 125px.
How can I adjust the width and scaling to it
Last edited by Christian; 10-23-07 at 04:39 AM.
Reason: Please use [PHP] tags when posting PHP code.
|

10-23-07, 07:07 AM
|
 |
Community Liaison
|
|
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
|
|
you will have to post the Graph class source or a link to the Graph class documentation before we can help you any further
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
|

10-23-07, 11:05 PM
|
|
Newbie Coder
|
|
Join Date: Oct 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I want the graph to look lik this.
The graph is attached is implemented in gdlib.
I am trying to implement the same in JPgraph.
I want to set the graph width manually.Please help me how can I proceed with it
PHP Code:
include ("/var/www/jpgraph-1.19/jpgraph.php"); include ("/var/www/jpgraph-1.19/jpgraph_line.php");
$ydata = array(11,280,57,10,7,100,200,54,100,5,1,9,13,5,7,45,11,3,8,12,45,53,56,11,34,57,10,7,34,23,54,100,5,1,9,13,5,7,45,11,3,8,12,45,53,56,11,34,57,10,7,34,23,54,100,5,1,9,13,5,7,45,11,3,8,12,45,53,56,11,34,57,10,7,34,23,54,100,5,1,9,13,5,7,45,11,3,8,12,45,53,56,11,34,57,10,7,34,23,54,10,10,10,10,10,10,10,45,11,3,8,12,45,53,56,11,34,57,10,7,34,23,54,100,5,1,9,13,5,7,45,11,3,8,12,45,53,56,45,53,56,11,34,57,10,7,34,200,5); $max=max($ydata); $graph = new Graph(620,200,"auto"); $graph->SetScale("textlin",0,$max); $graph->img->SetMargin(40,40,40,40); $lineplot = new LinePlot($ydata); $lineplot->SetColor("red"); $graph->xaxis-> title->Set("Time(hr)--------->" ); $graph->yaxis-> title->Set("%---------------->" );
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->SetMarginColor("red"); $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); $lineplot->SetLegend("Value Up"); $graph->legend->SetLayout(LEGEND_HOR); $graph->legend->Pos(.5,.9,"center","right"); $graph->legend->SetFillColor("lemonchiffon2:1.3"); $graph->yaxis->SetColor("red","black"); $graph->xaxis->SetColor("red","black"); $graph->xaxis->SetTickLabels($hours); $graph->xaxis->SetTextLabelInterval(2); $graph->xaxis->SetFont(FF_FONT1,FS_BOLD); $graph->yaxis->SetFont(FF_FONT1,FS_BOLD); $graph->xaxis->SetTextTickInterval(6); $graph->yaxis->SetTextLabelInterval(2); $graph->yaxis->HideFirstLastLabel(); $graph->SetBackgroundGradient('lemonchiffon','white',GRAD_MIDHOR,BGRAD_PLOT); $graph->SetMarginColor('lemonchiffon2:1.3'); $graph->ygrid->SetColor('orange'); ddText($txt);
$graph->Add($lineplot); //$graph->Add($lineplot2); $graph->Stroke();
Last edited by Christian; 10-24-07 at 12:39 AM.
Reason: Please use [php] tags!
|

10-24-07, 03:09 AM
|
 |
Code Guru
|
|
Join Date: Feb 2007
Location: New Zealand
Posts: 767
Thanks: 4
Thanked 2 Times in 2 Posts
|
|
Do you mean settings the Margins?
Untested. Not totally sure on this.
Let us know how you get on...
__________________
01010000 01001000 01010000
|

10-24-07, 04:06 AM
|
|
Newbie Coder
|
|
Join Date: Oct 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
SetMargin is to set the area.
But I want the graph to be plotted within the specified area.
Supppose width is 250px I want the width to plot with in 125px but the width should be 250px
|

10-24-07, 12:20 PM
|
 |
Level II Curmudgeon
|
|
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
|
|
I'd recommend asking this question in the JPGraph Help Forum.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|