/**
  * Current week top search strings report
  */
 public function graph1()
 {
     $myConfig = $this->getConfig();
     $oDb = oxDb::getDb();
     $aDataX = array();
     $aDataY = array();
     $sTimeFrom = $oDb->quote(date("Y-m-d H:i:s", strtotime(oxRegistry::getConfig()->getRequestParameter("time_from"))));
     $sTimeTo = $oDb->quote(date("Y-m-d H:i:s", strtotime(oxRegistry::getConfig()->getRequestParameter("time_to"))));
     $sSQL = "select count(*) as nrof, oxparameter from oxlogs where oxclass = 'search' and oxtime >= {$sTimeFrom} and oxtime <= {$sTimeTo} group by oxparameter order by nrof desc";
     $rs = $oDb->execute($sSQL);
     if ($rs != false && $rs->recordCount() > 0) {
         while (!$rs->EOF) {
             if ($rs->fields[1]) {
                 $aDataX[] = $rs->fields[0];
                 $aDataY[] = $rs->fields[1];
             }
             $rs->moveNext();
         }
     }
     header("Content-type: image/png");
     // New graph with a drop shadow
     $graph = new Graph(800, max(640, 20 * count($aDataX)));
     $graph->setBackgroundImage($myConfig->getImageDir(true) . "/reportbgrnd.jpg", BGIMG_FILLFRAME);
     // Use a "text" X-scale
     $graph->setScale("textlin");
     $top = 60;
     $bottom = 30;
     $left = 80;
     $right = 30;
     $graph->set90AndMargin($left, $right, $top, $bottom);
     // Label align for X-axis
     $graph->xaxis->setLabelAlign('right', 'center', 'right');
     // Label align for Y-axis
     $graph->yaxis->setLabelAlign('center', 'bottom');
     $graph->setShadow();
     // Description
     $graph->xaxis->setTickLabels($aDataY);
     // Set title and subtitle
     $graph->title->set("Suchw�rter");
     // Use built in font
     $graph->title->setFont(FF_FONT1, FS_BOLD);
     // Create the bar plot
     $bplot = new BarPlot($aDataX);
     $bplot->setFillGradient("navy", "lightsteelblue", GRAD_VER);
     $bplot->setLegend("Hits");
     $graph->add($bplot);
     // Finally output the  image
     $graph->stroke();
 }