Page 1 of 1

size the jpgraph ?

Posted: Wed 28 Apr 2010 7:09 pm
by n9mfk
Hi all
I need some help
here the page I working on
http://www.n9mfk.com/graphs/
how wood I size the jpgraph Thanks Beau

Re: size the jpgraph ?

Posted: Wed 28 Apr 2010 7:16 pm
by daj
In your PHP for each graph you will have something that initializes a new graph, similar to ....

$graph = new Graph($width, $height);

Change the figures for Width and Height

Re: size the jpgraph ?

Posted: Wed 28 Apr 2010 9:08 pm
by gemini06720
daj wrote:In your PHP for each graph you will have something that initializes a new graph, similar to ....
Indeed, Beau, as suggested by David, there are some parameters to be modified inside each PHP scripts.

On my site, I am using a different type of scripts to produce the JpGraph graphics - a user is being shown smaller graphics when the 'Narrow' screen option is chosen and larger graphics when the 'Wide' screen option is chosen ... as can be seen at the following link: [link removed]

Re: size the jpgraph ?

Posted: Fri 30 Apr 2010 1:38 pm
by n9mfk
Hi
Ray
what value did you you set to narrow
thanks Beau

Re: size the jpgraph ?

Posted: Fri 30 Apr 2010 7:10 pm
by gemini06720
n9mfk wrote:...what value did you you set to narrow
Beau, if you are using the same graphic package, then there should be configuration file - in my installation, the file is named 'graphsconf.php'.

Somewhere down the code, I have the following default values:

Code: Select all

//Now some variables which tailor the graphs
// graphs  - narrow screen
$xsizen           = 315; // width
$ysizen           = 210; // height
// graphs  - wide screen
$xsizew           = 540; // width
$ysizew           = 360; // height

// large graphs - used for rain & solar radiation
// large graphs - narrow screen
$xsize2n           = 540; // width
$ysize2n           = 360; // height
//large graphs - wide screen
$xsize2w           = 1000; // width
$ysize2w           = 670; // height

// tank-type graphs - used for rain and snow
// tank type graphs - narrow screen
$xsize1n          = 90; //width
$ysize1n          = 240; // height
// tank type graphs - wide screen
$xsize1w          = 180; //width
$ysize1w          = 480; // height
Is that of any help?

Re: size the jpgraph ?

Posted: Sat 01 May 2010 8:28 pm
by n9mfk
Thanks Ray

Re: size the jpgraph ?

Posted: Sat 01 May 2010 11:17 pm
by gemini06720
Beau, I had a look at your 'Sample Blank Page' ... the one with the graph images...

Why do you not make the graph images a little smaller so you can fit 2 graph imagess side-by-side?

...or, maybe, 2 graph images can already be fitted side-by-side with their present sizes... ;)

It might be a good idea to include the graph images within a table ensuring there is a little gap between each graph images... :roll:

Instead of this:

Code: Select all

<h3>24 Hour Graphs - Frequency 4 times an hour</h3>
<img  src="temp.php?freq=2" alt="Temp Graph" />
<img src="intemp.php?freq=2" alt="Indoor Temp Graph" />
<img src="dewpt.php?freq=2" alt="Dewpt Graph" />
<img src="wind.php?freq=2" alt="Wind Graph" />
<img src="rain.php?freq=2" alt="Rain Graph" />
<img src="winddir.php?freq=2" alt="Wind Dir Graph" />
<td colspan="2"><img src="baro.php?freq=2" alt="Baro Graph" />
...
Maybe some better HTML coding within your PHP file, such as:

Code: Select all

<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
  <th colspan="2" style="text-align: left;"><h3>24 Hour Graphs - Frequency 4 times an hour</h3></th>
</tr>
<tr>
  <td align="center" valign="middle"><img  src="temp.php?freq=2" alt="Temp Graph" /></td>
  <td align="center" valign="middle"><img src="intemp.php?freq=2" alt="Indoor Temp Graph" /></td>
</tr>
<tr>
  <td align="center" valign="middle"><img src="dewpt.php?freq=2" alt="Dewpt Graph" /></td>
  <td align="center" valign="middle"><img src="rain.php?freq=2" alt="Rain Graph" /></td>
</tr>
<tr>
  <td align="center" valign="middle"><img src="wind.php?freq=2" alt="Wind Graph" /></td>
  <td align="center" valign="middle"><img src="winddir.php?freq=2" alt="Wind Dir Graph" /></td>
</tr>
<tr>
  <td colspan="2" align="center" valign="middle"><img src="baro.php?freq=2" alt="Baro Graph" /></td>
</tr>
</table>
...

Re: size the jpgraph ?

Posted: Thu 06 May 2010 8:45 pm
by n9mfk
Hi Ray,
take a look at http://www.n9mfk.com/graphs/
put it in standard mode beau

Re: size the jpgraph ?

Posted: Fri 07 May 2010 11:39 am
by gemini06720
Beau, it appears that there is an error in the 'tnetwebtags.php' script...
n9mfk wrote:put it in standard mode
OK, the graphs are there - is there something else I should see??

Re: size the jpgraph ?

Posted: Fri 07 May 2010 12:05 pm
by n9mfk
Hi Ray,
I set them them to fit the smaller page
Beau

Re: size the jpgraph ?

Posted: Fri 07 May 2010 12:10 pm
by gemini06720
n9mfk wrote:I set them them to fit the smaller page
What width did you use in the graph configuration - from what I can see on the page, the width of each graph should not exceed 330px.

By the way, I have posted a correction for 'tnetwebtags.php' script...

Re: size the jpgraph ?

Posted: Fri 07 May 2010 5:16 pm
by n9mfk
Hi ray It 330
Thanks for the other fix to Beau