Ask a Question related to PHP Development, Design and Development.
-
Richard Hockey #1
Re: Web graph ?????
I've a couple of tricks to generate bar charts on the fly, using GD in one
instance, and spacer images/TD cells in the other
Using GD / javascript:
graph.htm
<script language="javascript">
function VUgauge(gaugeID)
{
var n=20;
var time=new Date();
var n=time.getSeconds();
n=Math.floor((n*100)/60);
document.getElementById(gaugeID).src='makepng.php? percent='+n;
var temp=setTimeout("VUgauge('gauge1')",1000);
}
</script>
<body onLoad="VUgauge('gauge1');">
<img name="guage1" alt="bar size controlled by javascript function VUgauge">
<img src="graph.php?percent=45" alt="bar size set by percent parameter">
</body>
graph.php
<?php
// read url parameter 'percent'
$percent=$_GET["percent"];
// calculate size of bar
$x1=floor(460*($percent/100));
// build image
$im = ImageCreate(500, 50);
// set colours, first colour created is background
$black = ImageColorAllocate($im, 0, 0, 0);
$white = ImageColorAllocate($im, 255, 255, 255);
$red = ImageColorAllocate($im, 255, 0, 0);
// set up array defining vertices of hexagonal bar, width depends on
'percent' parameter
$points=array(10,25,20,45,($x1+20),45,($x1+30),25, ($x1+20),5,20,5);
// draw polygon using array 'points' and colour red
imagefilledpolygon($im,$points,6,$red);
// write text on top of bar
imagestring($im,5,20,20,$percent.'%',$white);
// send the image to the browser
header("Content-type: image/png");
ImagePNG($im);
// tidy up
ImageDestroy($im);
?>
and for TD cells
<?php
$tablewidth=500;
$value=45;
$total=200;
$cell1=$tablewidth*($value/$total);
$cell2=$tablewidth-$cell1;
echo "<tr>";
echo "<td><td width=\"".$cell1."\" bgcolor=\"#ff0000\"><img
src=\"images/spacer.gif\" width=\"".$cell1."\"></td>";
echo "<td><td width=\"".$cell2."\" bgcolor=\"#eeeeee\"><img
src=\"images/spacer.gif\" width=\"".$cell2."\"></td>";
echo "</tr>";
?>
"E-Star" <unix_core@linuxmail.org> wrote in message
news:150720030242250833%unix_core@linuxmail.org...> I'm trying to build a webiste that produced a graph. Any good php
> packages out there?
>
> I came across Web Chart Creator ([url]www.ankord.com[/url]). Is this any good?
> Any one use it?
Richard Hockey Guest
-
Graph.0.69 Module---how to get a DAG from graph with cycles
Here I use an example to illustrate the problem I met when using Graph Theory Module: I have a directed graph looks like the following (see the... -
GD graph, Several Colors per Bar?
Hi. I'm struggling with a GD::Graph -problem. I want to create a graph with bars by adding(+) the execution time from each little job within my... -
GD::Graph - how to get rid of leading gap in line graph?
Is there a way to get rid of the leading gap to the left of a line graph? Therefore, I want the graph line to start on the Y-axis, not the... -
ANNOUNCE: Graph::Timeline and Graph::Timeline::GD 1.0
Graph::Timeline - Render timeline data This document refers to verion 0.1 of Graph::Timeline, released November 11, 2003 This class takes a... -
save graph to gif or jpg
Is there / what is the PHP function that saves a dynamcially drawn chart to a image file (either gif or jpeg)? Also, an advanced PHP book... -
Kevin Thorpe #2
Re: Web graph ?????
E-Star wrote:
I use jpGraph ([url]www.aditus.nu/jpgraph[/url])> I'm trying to build a webiste that produced a graph. Any good php
> packages out there?
>
> I came across Web Chart Creator ([url]www.ankord.com[/url]). Is this any good?
> Any one use it?
Kevin Thorpe Guest
-
Klym #3
Re: Web graph ?????
Daniel Bußmeyer <daniel@bussmeyer.com> wrote in message news:<bf0mis$9rotv$1@ID-199942.news.uni-berlin.de>...
I used phplot and found it to be very useful: [url]http://www.phplot.com[/url]> Kevin Thorpe wrote:> Hi!> > E-Star wrote:
> >> >> >> I'm trying to build a webiste that produced a graph. Any good php
> >> packages out there?
> >>
> >> I came across Web Chart Creator ([url]www.ankord.com[/url]). Is this any good?
> >> Any one use it?
> >
> > I use jpGraph ([url]www.aditus.nu/jpgraph[/url])
> >
> >
>
> You can try baaChart. It's a lib you can use to draw many kinds of
> 2d-charts.
> try: [url]http://members.aol.com/barryaandrew/baaChart/baachartguide.html[/url]
Klym Guest
-
Bad Man #4
Re: Web graph ?????
On 15 Jul 2003, E-Star <unix_core@linuxmail.org> impressively belched the
following:
ladies and gentlemen, in 3rd place this week on phpclasses.org:> I'm trying to build a webiste that produced a graph. Any good php
> packages out there?
>
> I came across Web Chart Creator ([url]www.ankord.com[/url]). Is this any good?
> Any one use it?
3rd Place:
Herman Veluwenkamp
Class - Graph Drawing Class 2
[url]http://www.phpclasses.org/browse.html/package/176.html[/url]
Wins - developers version of Template Tamer.
Bad Man Guest
-
Disco #5
Re: Web graph ?????
E-Star wrote:
Like Kevin Thorpe, I use JPGraph.> I'm trying to build a webiste that produced a graph. Any good php
> packages out there?
>
> I came across Web Chart Creator ([url]www.ankord.com[/url]). Is this any good?
> Any one use it?
It is extremely thourough and flexible.
Disco Guest



Reply With Quote

