define("CHART_VERSION", "2.5"); /******************updates**************** *2.0 - start *2.1 - default missing/empty Unit Symbol to null *2.2 - Round width of bar to integer *2.3 - remove 2nd parameter (unit symbol) *2.4 - Reverse sort the page names for the graph *2.5 - Introduce graph Type = s(sort) /****************** * phpHtmlChart * * This function will output a bar chart in HTML given * the supplied information. * The data array should be a multi-dim array as follows: * 0 1 2 * ------------------------------------------- * | Data Label | | Data Value | Unit Symbol | * ------------------------------------------- * 0 | Apples | | 50 | f | * 1 | Oranges | | 25 | f | * ------------------------------------------- * * @author Jason D. Agostoni (jason@agostoni.net) * @Updated by Walter Mann (wm@walcam.co.uk) * @param $paData Multi-dim array of graph data * @param $psOrientation (optional) Currently unused * @param $psTitle (optional) Chart title (prints on the top) * @param $psAxisLabel (optional) Axis Label (prints on the data axis) * @param $psFontSize (optional) Font size to use for label/title (ex. 8pt) * @param $piMaxSize (optional) Max size of the graph (width for Horiz., Height for Vert.) * @param $psMaxSizeUnit (optional) Measurement unit of max size (px, cm, mm, etc.) * @param $piBarSize (optional) Width of the bar * @param $psBarUnit (optional) Measurement unit of the bar width * @param $paColors (optional) Array of HTML color codes to cycle through for bar colors * @return Returns the HTML to render the chart */ function phpHtmlChart($paData, $type = 'H', $psTitle = '', $psAxisLabel = '', $psFontSize = '8pt', $piMaxSize = 100, $psMaxSizeUnit = 'px', $piBarSize = 15, $psBarUnit = 'px', $paColors = Array('#a0a0a0', '#707070')) { $iColors = sizeof($paColors); //Reverse sort the table by hits if (substr_count($type,'s') > 0) { arsort($paData); } // Start HTML... $sHTML = "
$psTitle |
";
// Headers/scale
$iMax = 0;
// for($iRow = 0; $iRow < sizeof($paData); $iRow++) {
foreach ($paData as $key => $val) {
// Test for max...
// if($paData[$iRow][1] > $iMax) $iMax = $paData[$iRow][1];
if($val > $iMax) $iMax = $val;
// Ouput the label
// $sHTML .= " ".$paData[$iRow][0]." ";
$sHTML .= "".$key." ";
} // Rows in paData...
$iScale = $iMax / $piMaxSize;
$sHTML .= "
|
|
$psAxisLabel |
|
|||
Version: 1.17 Using Counter: 1.09 |
Total | |||||||||
Page | Thu | Fri | Sat | Sun | Mon | Tue | Wed | Today | to Date |
index | 1 | 6 | 0 | 2 | 1 | 1 | 4 | 2 | 2562 |
kitchen | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 1 | 741 |
bathroom | 0 | 2 | 0 | 1 | 0 | 0 | 2 | 0 | 733 |
conservatory | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 710 |
outside | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 972 |
why_tile | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 677 |
contact | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 1 | 729 |
emform | 0 | 1 | 2 | 1 | 0 | 0 | 0 | 0 | 568 |
thankyou | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
TOTALS | 3 | 16 | 4 | 9 | 1 | 3 | 8 | 6 | 7695 |
Fatal error: Uncaught Error: Call to undefined function phpHtmlChart() in /home/wlunrcvv/public_html/mltiling/counters/index.php:246
Stack trace:
#0 {main}
thrown in /home/wlunrcvv/public_html/mltiling/counters/index.php on line 246