. .

Kategorie: JpGraph RSS-Feed für diese Kategorie

0

JpGraph: Beispiel: AccBarPlot: Positionsseite in Google

JpGraph: Beispiel: AccBarPlot: Positionsseite in Google

  <?PHP $monate = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); foreach ($monate as $monat) { $liste[$monat] = array(); for ($r = 0; $r < 5; $r++) $ergebnis[$r][] = 0; } /* * access_log wurde vorher mit * "grep '/2008:' access_log" auf das Jahr 2008 reduziert */ $handle = fopen("access_log", "r"); while (!feof($handle)) { $zeile = fgets($handle, 4096); $monat = explode("/", $zeile); $monat = $monat[1]; if ($p = (strstr($zeile, "google"))) { if ($p = (strstr($p, "?"))) { $p = substr($p, 1); if ($q = explode("&", $p)) { $query = NULL; $start = 1; foreach ($q

0

JpGraph: Klassenerweiterung „ErrorPlotValues“

JpGraph: Klassenerweiterung „ErrorPlotValues“

Die Klasse „Plot“ bzw. „ErrorPlots“ von JpGraph bot nicht die Möglichkeit, die entsprechenden Werte darzustellen, die den Balken bestimmen. Der Entwickelr von JpGraph konnte sich leider auf meine Anfrage nicht melden. Daher gebe ich die Klassenerweiterung (recht spezifisch) hier bekannt: <?PHP /* * a small class extension for displaying percentage or absolute values * inside ErrorPlots * by Hofmann R. Julian // 16. Januar 2009 * # new ErrorPlotValues( # [array like for normal ErrorPlot], # [xValues array like for normal ErrorPlot], # [FALSE = percentage, TRUE = absolute values], # [width of the upper and lower line] # );

0

JpGraph: Beispiel: GanttBar: Hits durch Suchmaschinen

JpGraph: Beispiel: GanttBar: Hits durch Suchmaschinen

  <?PHP function sBrowser($stext) { if (strpos($stext, "Googlebot") > 0) return (0); if (strpos($stext, "oogle-Sitemaps") > 0) return (0); if (strpos($stext, "Yahoo!") > 0) return (1); if (strpos($stext, "snbot") > 0) return (2); return(FALSE); } $suche = "2008-11-17"; $suchmaschinen = array( array("Google", "#00B00C"), array("Yahoo", "#0095FF"), array("MSN", "#E15600") ); list($jahr, $monat, $tag) = explode("-", $suche); $kw = date("W", strtotime($suche)); for ($z = 0; $z < count($suchmaschinen); $z++) $suMa[$z][] = 0; $monate = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); $handle = fopen("access_log2", "r"); while (!feof($handle)) { $zeile = fgets($handle, 4096); $gBrowser = explode("\"", $zeile); if (strstr($gBrowser[1],

0

JpGraph: Beispiel: RadarPlot: Hits nach Stunde

JpGraph: Beispiel: RadarPlot: Hits nach Stunde

  <?PHP function gProzent($alle, $anteil, $stellen = 2) { if ($anteil > 0) return (round(($anteil / ($alle / 100 )), $stellen)); else return 0; } for ($z = 12; $z > 0; $z–) { if ($z < 10) $z = "0{$z}"; $legende[] = "{$z}\n".((int) $z + 12); } $handle = fopen("access_log", "r"); while (!feof($handle)) { $zeile = fgets($handle, 4096); $gValidHit = explode("\"", $zeile); if (strstr($gValidHit[1], "?")) { $p = explode(" ", $zeile); $aHits[(int) substr($p[3], 13, 2)]++; } } fclose ($handle); for ($z = 0; $z <= 11; $z++) $aHitsPM[$z] = $aHits[(11 – $z)]; for ($z = 0; $z <= 11;

0

JpGraph: Beispiel: LinePlot: Statistik des entstandenen Traffics

JpGraph: Beispiel: LinePlot: Statistik des entstandenen Traffics

  <?PHP function sBrowser($stext) { if (strpos($stext, "Googlebot") > 0) return (2); if (strpos($stext, "oogle-Sitemaps") > 0) return (2); if (strpos($stext, "Yahoo!") > 0) return (2); if (strpos($stext, "snbot") > 0) return (2); if (strpos($stext, "Safari") > 0) return (1); if (strpos($stext, "Firefox") > 0) return (1); if (strpos($stext, "MSIE") > 0) return (1); if (strpos($stext, "pera/") > 0) return (1); if (strpos($stext, "BonEcho") > 0) return (1); if (strpos($stext, "ozilla") > 0) return (1); return (NULL); } $Monat = "Nov/2008"; $lMonat = "Oct/2008"; $monate = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); $WochenTage =

0

JpGraph: Beispiel: ScatterPlot: Statistik über die Abweichung der Besucher nach Tagen

JpGraph: Beispiel: ScatterPlot: Statistik über die Abweichung der Besucher nach Tagen

  <?PHP /* * Suchmaschinen sind inbegriffen. */ $Monat = "Nov/2008"; $Anzahl = date("t", strtotime("01. ".(str_replace("/", " ", $Monat)))); $WochenTage = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"); for ($z = 1; $z <= $Anzahl; $z++) { $aBesucher[] = 0; $xAchse[] = $z; } $handle = fopen("access_log", "r"); while (!feof($handle)) { $zeile = fgets($handle, 4096); $gURL = explode("\"", $zeile); if (strstr($gURL[1], "?")) { if (strstr($gURL[0], $Monat)) { $p = explode(" ", $zeile); $ts = strtotime((substr($p[3], 8, 4))."-" .(date("m", strtotime("01. ".(str_replace("/", " ", $Monat))))) ."-{$p[3][1]}{$p[3][2]} ".(substr($p[3], 13, 8))); $Besucher[$p[0]][0] = $ts; if ( (!($Besucher[$p[0]][1])) || (($oBrowser <> $fBrowser) && ($p[0] ==

0

JpGraph: Beispiel: PiePlotC: Statistik der Besucher nach Land bzw. Domain

JpGraph: Beispiel: PiePlotC: Statistik der Besucher nach Land bzw. Domain

  <?PHP function gDomain($sDomain, &$vDomains) { $c = geoip_country_code_by_name($sDomain); if (in_array($c, $vDomains)) return (array_search($c, $vDomains)); return (count($vDomains) – 1); } /* * Die hier dargestellte Ermittlung der Domains spiegelt nicht die * tatsaechliche Verteilung der Domains der Besucher da, da mehrfache * Besuche gleicher IP-Adressen nicht beruecksichtig werden. */ $Domains = array("Deutschland", "Oesterreich", "Schweiz", "andere"); $vDomains = array("DE", "AT", "CH", "%"); for ($z = 0; $z < count($Domains); $z++) $aDomains[$z] = 0; $handle = fopen("access_log", "r"); while (!feof($handle)) { $zeile = fgets($handle, 4096); $iDomain = explode("\"", $zeile); if (strstr($iDomain[1], "?")) { $p = explode(" ", $zeile); if (!$bDomains[$p[0]]) $bDomains[$p[0]] =

0

JpGraph: Beispiel: BarPlot: Statistik der verwendeten Browser eines Besuchers

JpGraph: Beispiel: BarPlot: Statistik der verwendeten Browser eines Besuchers

  <?PHP function gProzent($alle, $anteil, $stellen = 2) { if ($anteil > 0) return (round(($anteil / ($alle / 100 )), $stellen)); else return 0; } function sBrowser($stext) { if (strpos($stext, "Googlebot") > 0) return(10); if (strpos($stext, "oogle-Sitemaps") > 0) return(10); if (strpos($stext, "Yahoo!") > 0) return(11); if (strpos($stext, "snbot") > 0) return(12); if (strpos($stext, "Safari") > 0) return (4); if (strpos($stext, "Firefox") > 0) return (2); if (strpos($stext, "MSIE") > 0) return (0); if (strpos($stext, "pera/") > 0) return (3); if (strpos($stext, "BonEcho") > 0) return (4); if (strpos($stext, "ozilla") > 0) return (1); return (5); } $browser = array("Internet\nExplorer",