Page 1 of 1
the most efficent & all around best way to create graphs
Posted: Tue Aug 26, 2003 2:59 pm
by m3mn0n
I would like ones similar to the ones here:
http://playteq.com/stats.asp
The options I've explored are
Ming and
SVG. Out of the two, so far Ming is looking to be the one i go with. SVG = XML Derivative and the book I read about it cautioned me to be wary about compatability issues from browser to browser and etc. Also Ming seems to be the best choice since the coding would be all php and no XML, plus there isn't a pc around without the flash plugin.
Is there anything else possible? Any recommendations? And if you know of any good prebuilt classes for graphs in php/mysql please let me know.
Thanks in advanced.
Posted: Tue Aug 26, 2003 4:09 pm
by Judas
I wich i knowe more about PHP rendering .swf
Posted: Tue Aug 26, 2003 4:18 pm
by Unipus
You mean, "I wish I knew more about Flash." PHP's rendering has very little to do with it, as far as I know. Flash simply accepts variables that you can pass to it from PHP. You can use those variables in your ActionScript to make neat things happen. I don't know of any pre-built solutions, though, and there are a few good reasons not to make infographics in Flash anyway.
Posted: Tue Aug 26, 2003 4:36 pm
by Judas
O boy .
pfff
Take a look at this you can also create flash with PHP .
The 1 thing = ya must install it first.
Code: Select all
<?php
swf_openfile ("test.swf", 256, 256, 30, 1, 1, 1);
swf_ortho2 (-100, 100, -100, 100);
swf_defineline (1, -70, 0, 70, 0, .2);
swf_definerect (4, 60, -10, 70, 0, 0);
swf_definerect (5, -60, 0, -70, 10, 0);
swf_addcolor (0, 0, 0, 0);
swf_definefont (10, "Mod");
swf_fontsize (5);
swf_fontslant (10);
swf_definetext (11, "This be Flash wit PHP!", 1);
swf_pushmatrix ();
swf_translate (-50, 80, 0);
swf_placeobject (11, 60);
swf_popmatrix ();
for ($i = 0; $i < 30; $i++) {
$p = $i/(30-1);
swf_pushmatrix ();
swf_scale (1-($p*.9), 1, 1);
swf_rotate (60*$p, 'z');
swf_translate (20+20*$p, $p/1.5, 0);
swf_rotate (270*$p, 'z');
swf_addcolor ($p, 0, $p/1.2, -$p);
swf_placeobject (1, 50);
swf_placeobject (4, 50);
swf_placeobject (5, 50);
swf_popmatrix ();
swf_showframe ();
}
for ($i = 0; $i < 30; $i++) {
swf_removeobject (50);
if (($i%4) == 0) {
swf_showframe ();
}
}
swf_startdoaction ();
swf_actionstop ();
swf_enddoaction ();
swf_closefile ();
?>
code from
http://nl3.php.net/swf
also note this site
http://www.blue-pac.com/
Posted: Tue Aug 26, 2003 5:00 pm
by pootergeist
as all those graphs ar cron'd either hourly or every 12 hours you hardly need flash at all - could as easily do it with server cached images.
writing the algorythm to create them from a data array wouldn't be at all tricky - just a matter of running a gradient background and slinging a few lines and points on them.
With a bit of work (and some free time) and GD above 2.0.4 I could more than likely get better results than they have there just by creating cached ping files. An
example of a graphing function using just GD (note. when I get time I will improve the render algorythm about 5 fold and will change to a gaussian anti-alias technique for smoother results.
As mentioned on that page, I will be distro'ing a DataGraphs class when I have time to finish the seperate functions.
You might also check out jpGraph as another free distro.
Posted: Wed Aug 27, 2003 6:18 am
by m3mn0n
Wow that donut chart is cool. I will definatley test it out.
Any solutions for bar & scatter plot charts?
Posted: Wed Aug 27, 2003 9:50 am
by pootergeist
Just about all graph style imaginable are 'on the agenda' - just a matter of finding the time between other ventures. Realistically I am not going to have anything distro'able for at least a month.
Am deliberating on the line graph approach as a shaded tube style gives the impression of the lines growing toward the foreground ( eg
http://www.teckis.com/scriptix/datagraphs/s.php.png ) - might need a rhombus perspective background to balance it. Obviously a lot more work to do there before anything becomes usable.
Posted: Wed Aug 27, 2003 7:48 pm
by m3mn0n
Looks great. I'm looking forward to your apps release.
I never relized the imaging power of the gd library until now, heh. I will be tinkering around a lot more than usual with it now. Thanks for the eye-opener.
