| ".$lang['admin']['stats_rank']." |
".$lang['admin']['stats_prod_name']." |
".$lang['admin']['stats_views']." |
".sprintf($lang['admin']['stats_percent_total'],$totalHits[0]['totalHits'])." |
\n";
for ($i=0; $i<$noResults; $i++) {
$cellColor = cellColor($i);
$percentage = 100 * ($results[$i]['popularity'] / $totalHits[0]['totalHits']);
$percentage = number_format($percentage,2);
if ($percentage >= 1) {
$position = (($page*$rowsPerPage)+1)+$i;
$chartData[] = array($position, $percentage);
$keyStr .= "
| ".$position." |
".$results[$i]['name']." |
".$results[$i]['popularity']." |
".$percentage."% |
\n";
}
}
$keyStr .= "
";
$imageNo++;
$filename = md5(CC_ROOT_DIR.$glob['license_key'].$imageNo).".png";
$graph = new PHPlot;
$graph->SetDataValues($chartData);
$graph->SetIsInline(true);
$graph->PHPlot(550,300,"cache".CC_DS.$filename);
$graph->SetPlotType("bars");
$graph->SetXLabelAngle("0");
$graph->skip_right_tick = TRUE;
$graph->SetNumXTicks(1);
$graph->SetTitle($lang['admin']['stats_product_pop']." (".(($page*$rowsPerPage)+1)." - ".(($page*$rowsPerPage) + count($chartData)).")");
$graph->SetXTitle($lang['admin']['stats_product_name_key']);
$graph->SetYTitle($lang['admin']['stats_product_views']);
$graph->DrawGraph();
echo "