cvs: phpweb / usage.php /bin barchart.phl generate-netcraft-chart /gifs/stats phpstats-200106.png
| From: | Rasmus Lerdorf | Date: | Sat, 21 Jul 2001 02:27:53 +0000 |
| Subject: | cvs: phpweb / usage.php /bin barchart.phl generate-netcraft-chart /gifs/stats phpstats-200106.png | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-5639@lists.php.net to get a copy of this message | ||
rasmus Fri Jul 20 22:27:53 2001 EDT
Added files:
/phpweb/gifs/stats phpstats-200106.png
Modified files:
/phpweb usage.php
/phpweb/bin barchart.phl generate-netcraft-chart
Log:
June numbers - spruce up the graph code slightly. It now generates a PNG
instead of a GIF to be more politically correct and it also uses slightly
transparent bars.
Index: phpweb/usage.php
diff -u phpweb/usage.php:1.17 phpweb/usage.php:1.18
--- phpweb/usage.php:1.17 Sun Jul 8 08:46:23 2001
+++ phpweb/usage.php Fri Jul 20 22:27:52 2001
@@ -3,15 +3,15 @@
commonHeader("PHP Usage Stats");
?>
-<h1>Usage Stats for May 2001</h1>
+<h1>Usage Stats for June 2001</h1>
<p>
-PHP: 6280233 Domains, 941419 IP Addresses<br>
+PHP: 6751394 Domains, 960954 IP Addresses<br>
Source: <a href="http://www.netcraft.com/Survey/">Netcraft</a><br>
</p>
<p>
-<?php echo print_image("stats/phpstats-200105.gif", "Graph"); ?>
+<?php echo print_image("stats/phpstats-200106.png", "Graph"); ?>
</p>
<p>
Index: phpweb/bin/barchart.phl
diff -u phpweb/bin/barchart.phl:1.1 phpweb/bin/barchart.phl:1.2
--- phpweb/bin/barchart.phl:1.1 Sat Jan 13 17:06:51 2001
+++ phpweb/bin/barchart.phl Fri Jul 20 22:27:53 2001
@@ -1,6 +1,6 @@
<?php /* -*- C++ -*- */
/*
-** $Id: barchart.phl,v 1.1 2001/01/13 22:06:51 jimw Exp $
+** $Id: barchart.phl,v 1.2 2001/07/21 02:27:53 rasmus Exp $
** $Source: /usr/repository/phpweb/bin/barchart.phl,v $
**
** PHP Class for creating bar charts using the GD library functions.
@@ -101,7 +101,7 @@
function init($x, $y, $d, $c, $l) {
$this->min_allowed_max = 5;
- $this->im = ImageCreate($x, $y);
+ $this->im = ImageCreateTrueColor($x, $y);
$this->width = $x;
$this->height = $y;
@@ -140,11 +140,24 @@
$num_colors = count($c);
+ ImageAlphaBlending($this->im, false);
+ ImageFilledRectangle($this->im, 0, 0, $x, $y, $this->white);
+ ImageAlphaBlending($this->im, true);
+
for ($i = 0; $i < $num_colors; $i++) {
- $this->colors[] = ImageColorAllocate($this->im,
+ if(count($c[$i])>3) {
+ $this->colors[] = ImageColorResolveAlpha($this->im,
+ $c[$i][0],
+ $c[$i][1],
+ $c[$i][2],
+ $c[$i][3]);
+
+ } else {
+ $this->colors[] = ImageColorAllocate($this->im,
$c[$i][0],
$c[$i][1],
$c[$i][2]);
+ }
}
}
@@ -352,7 +365,7 @@
$this->draw_legends($this->legend_font);
$this->draw_bars();
- ImageGif($this->im);
+ ImagePNG($this->im);
}
Index: phpweb/bin/generate-netcraft-chart
diff -u phpweb/bin/generate-netcraft-chart:1.2 phpweb/bin/generate-netcraft-chart:1.3
--- phpweb/bin/generate-netcraft-chart:1.2 Wed Apr 11 16:33:44 2001
+++ phpweb/bin/generate-netcraft-chart Fri Jul 20 22:27:53 2001
@@ -1,10 +1,10 @@
-#!/usr/local/bin/php
+#!/usr/local/bin/php -q
<?php // -*- C++ -*-
require("./barchart.phl");
$stats = array(
- /*
+ /*
199806 => array(71360, 47329),
199807 => array(81337, 53361),
199808 => array(90641, 58078),
@@ -12,7 +12,6 @@
199810 => array(129757, 73063),
199811 => array(220286, 81141),
199812 => array(241924, 87273),
- */
199901 => array(278297, 90264),
199902 => array(345549, 101140),
199903 => array(409418, 143667),
@@ -25,6 +24,7 @@
199910 => array(931122, 321128),
199911 => array(1114021, 357481),
199912 => array(1256216, 378301),
+ */
200001 => array(1271060, 391876),
200002 => array(1412822, 428840),
200003 => array(1783626, 462510),
@@ -39,17 +39,20 @@
200012 => array(4775580, 803889),
200101 => array(5104536, 832457),
200102 => array(5558363, 856543),
- 200103 => array(5747237, 882439)
+ 200103 => array(5747237, 882439),
+ 200104 => array(6156321, 914146),
+ 200105 => array(6280233, 941419),
+ 200106 => array(6751394, 960954)
);
$rgb_colors = array(
- array(205,85,85), // IndianRed3
- array(72,61,139), // royal blue
- array(139,58,98), // scarlet/purple
- array(0,139,139), // green/gray/blue
- array(238,118,0), // orange
- array(139,69,19), // dark red-brown
- array(65,105,225) // clear blue
+ array(205,85,85,15), // IndianRed3
+ array(72,61,139,15), // royal blue
+ array(139,58,98,15), // scarlet/purple
+ array(0,139,139,15), // green/gray/blue
+ array(238,118,0,15), // orange
+ array(139,69,19,15), // dark red-brown
+ array(65,105,225,40) // clear blue
);
$currcol = 0;
$months = array(1 => "Jan", "Feb", "Mar", "Apr",
"May", "Jun",